我在最后一行<?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 } ?>
答案 0 :(得分:0)
您在;
<?php endif ?>
将此<?php endif ?>
更改为<?php endif; ?>