0

I'm simple programmer so please be patient with me i coding a new website but i have some issues and i hope you will helps me

I want to link my page in button by php but with a condition

the condition : if the $_SESSION ['use'] = $username i want to show Logout button but if the $_SESSION ['use'] = NULL i want to show Login button,

  <?php
     session_start();
     $username = $_POST ['uname'];
     $password = $_POST ['pass'];

     if ($_SESSION['use'] = $username) 
     {
     echo '<a href="http://localhost/project/LogoutPage.html" > Logout </a>';
     } 
     if ($_SESSION['use'] = NULL) 
     {
     echo '<a href="http://localhost/project/LoginIndex.html" > Login </a>';
     }
  ?>

this the output:

Logout '; } if ($_SESSION['use'] = NULL) { echo ' Login '; } ?> 
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119

0 Answers0