Welcome Guest, Not a member yet? Register   Sign In
i cant found the error at index.php
#1

im getting:

An uncaught Exception was encountered
Type: ParseError
Message: syntax error, unexpected end of file
Filename: /home/cole01/public_html/load/application/views/members/index.php
Line Number: 89
Backtrace:
File: /home/cole01/public_html/load/application/controllers/Members.php
Line: 36
Function: view
File: /home/cole01/public_html/load/index.php
Line: 315
Function: require_once


the index.php code

<!DOCTYPE html>
<html lang="en">
   
<head>
    <meta charset="utf-8">
    <title>CodeIgniter CSV Import</title>

    <!-- Bootstrap library -->
   
    <link rel="stylesheet" href="<?php echo base_url('assets/bootstrap/bootstrap.min.css'); ?>">
   
    <!-- Stylesheet file -->
    <link rel="stylesheet" href="<?php echo base_url('assets/css/style.css'); ?>">
</head>

<body>
<div class="container">
    <h2>Members List</h2>

    <!-- Display status message -->
   
    <?php if(!empty($success_msg)){ ?>
    <div class="col-xs-12">
        <div class="alert alert-success"><?php echo $success_msg; ?></div>
    </div>
    <?php if(!empty($error_msg)){ ?>
    <div class="col-xs-12">
        <div class="alert alert-danger"><?php echo $error_msg; ?></div>
    </div>
   
    <?php } ?>

    <div class="row">
        <!-- Import link -->
        <div class="col-md-12 head">
            <div class="float-right">
                <a href="javascript:void(0);" class="btn btn-success" onclick="formToggle('importFrm');"><i class="plus"></i> Import</a>
            </div>
        </div>

        <!-- File upload form -->
        <div class="col-md-12" id="importFrm" style="display: none;">
            <form action="<?php echo base_url('members/import'); ?>" method="post" enctype="multipart/form-data">
                <input type="file" name="file" />
                <input type="submit" class="btn btn-primary" name="importSubmit" value="IMPORT" >
            </form>
        </div>
       
        <!-- Data list table -->
        <table class="table table-striped table-bordered">
            <thead class="thead-dark">
                <tr>
                    <th>#ID</th>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Phone</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>
                <?php if(!empty($members)){ foreach($members as $row){ ?>
                <tr>
                    <td><?php echo $row['id']; ?></td>
                    <td><?php echo $row['name']; ?></td>
                    <td><?php echo $row['email']; ?></td>
                    <td><?php echo $row['phone']; ?></td>
                    <td><?php echo $row['status']; ?></td>
                </tr>
                <?php } }else{ ?>
                <tr><td colspan="5">No member(s) found...</td></tr>
                <?php }  ?> ;
                </tbody>
        </table>
    </div>
</div>
<script>
    function formToggle(ID){
        var element = document.getElementById(ID);
        if(element.style.display === "none"){
        element.style.display = "block";
        }else{
        element.style.display = "none";
    }
    }
</script>
</body>
</html>      < ---------- at this point editor shows SYNTAX ERROR, unexpected $EOF



any idea
Reply
#2

(This post was last modified: 04-16-2020, 03:22 AM by InsiteFX.)

PHP Code:
<?php if(!empty($success_msg)){ ?>
    <div class="col-xs-12">
        <div class="alert alert-success"><?php echo $success_msg?></div>
    </div>
<?php ?>
<?php 
if(!empty($error_msg)){ ?>
    <div class="col-xs-12">
        <div class="alert alert-danger"><?php echo $error_msg?></div>
    </div>

<?php ?>

Now do you see your Error?

You were missing the first if statements closing php tag.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB