我试图在第一个语句中实现第二个if语句,所有这些都在HTML中。 应该像这样工作:
如果没有,只显示“欢迎回来”(已知用户)
<?php if ($_SESSION['ID']): $log = 'Logout'; ?> <!-- If we have a session, login button becomes logout button-->
<h1>You are logged in <?php echo $_SESSION['Name']; ?>!</h1>
<?php if($_SESSION['locationcheck'] === False)?> <!-- If login script says location is missing, form comes up to enter location-->
<h2>Please complete by entering your location:</h2>
<!-- FORM TO ENTER LOCATION COMES UP-->
<?php endif; ?> <!-- This endif is unexpected-->
<?php else: $log = 'Login'; ?> <!-- We dont have a session, display login button-->
<h1>You are logged out!</h1>
<div><?php echo '<a href='.$helper->getLoginUrl().'>Login with fb</a>';?></div>
<?php endif ?>
我得到的错误是第一个endif是意外的。