dadamssg Posted April 7, 2009 Share Posted April 7, 2009 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 More sharing options...
hastishah Posted April 7, 2009 Share Posted April 7, 2009 Hi change the condition to <?php if ($_SESSION['auth'] != "yes" and $_SESSION['logname'] != '') ..... ?> Link to comment https://forums.phpfreaks.com/topic/152938-how-do-i-make-this-and-stmt-work/#findComment-803200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.