-1

I am not sure what is going on here but my login button does not show up if I used the following code:

But it does work if I removed the isset... I guess that I don't need to use isset for a login page because it is not sending any information?

I tried to use the same code but without the isset function and it works but most videos are using the isset function

<?php
include_once 'navbar.php';
session_start();
if(isset($_SESSION{'u_uid'})) {
echo '<div class="login_form">
         <div class="login_form_welcome">
            <h2>Welcome to the Login Form</h2>
          </div>
          <form action="medical_login_process.php" method="POST">
           <input type="text" name="username" placeholder="username/email">
           <br />
           <br />
            <input type="password" name="password" placeholder="password">
            <br />
           <br />
            <button type="submit" name="submit">Login</button>
       </div>';

   } else {
echo '  <div class="logout">
         <form action="medical_logout_process.php" method="POST">
           <button type="submit" name="logout">Logout</button>
      </div>';
   }
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
piano0011
  • 61
  • 7

1 Answers1

0

Change if(isset($_SESSION{'u_uid'})) { to if(isset($_SESSION['u_uid'])) {.

Note the use of square brackets instead of curly ones.

Just a heads up: I am voting to close this since it's a typo and isn't really of use to anyone but you.

Loek
  • 4,037
  • 19
  • 35