多个PHP如果HTML中的语句 - 意外的endif

Im trying to implement a second if statement inside a first statement, all of that inside HTML. Should work like this:

  • User logs in
  • Login Script checks if information is missing (New User)
  • If so, user needs to add it
  • If not, just display "welcome back" (Known User)

          <?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 ?>
    

The error I get is that the first endif is unexpected.