Jump to content

how do i make this 'and' stmt work


dadamssg

Recommended Posts

i want this to display when auth is not 'yes' AND when the logname session isn't set....this doesn't output the login form when it should

 

<?php	
session_start();

function login() {	 
if ($_SESSION['auth'] != "yes" and isset($_SESSION['logname']))
           {
            echo "<div id= 'login'>
                   <form action='login.php' method='POST'>
                   <fieldset>
                       Username: <br><input type='text' name='fusername' 
                      size='15' maxlength='15'><br>
                       Password: <br><input type='password' name='fpassword' 
                      size='15' maxlength='15'><br>
				  <a href=/test/register_form.php>Register</a><br>
                   <input type='hidden' name='do' 
                                     value='login'>
           
                <center><input type='submit' name='log' 
                             value='Login'></center>
	      </fieldset>
                      </form></div>";
           }
	    
if ($_SESSION['auth'] != "yes" and !isset($_SESSION['logname']))
           {
            
           }
	   else
	   {
	  echo "<a href='/Members/out.php'>Sign Out</a><br>";
	  }
	  }
?>  

 

help please :)

Link to comment
https://forums.phpfreaks.com/topic/152938-how-do-i-make-this-and-stmt-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.