有人可以查看我的PHP脚本吗?语法错误,意外'}'

时间:2017-11-22 07:21:10

标签: php html css

我在最后一行<?php } ?>收到错误,它说语法错误,意外'}'

<?php if (isset($_SESSION['u_id'])) { 
            //echo "You are logged in!";
             include_once 'database.php';
             $edit_state = false; ?>
                <h2>Welcome!</h2>
                <form method="POST" action="process.php">
                <div class="input-group">
                    <label>Reference Number: <label>
                    <input type="text" name="reference_no" value="">
                </div>
                <div class="input-group">
                    <label>Action Taken<label>
                    <input type="text" name="action_taken" value="">
                </div>
                <div class="input-group">
                <?php if ($edit_state == false): ?>
                    <button type="submit" name="save" class="btn">Save</button>
                <?php else: ?> 
                    <button type="submit" name="update" class="btn">Update</button>
                <?php endif ?>
                </div>
            </form>
        <?php } ?>

1 个答案:

答案 0 :(得分:0)

您在;

之后错过了<?php endif ?>

将此<?php endif ?>更改为<?php endif; ?>