Xyphon Posted December 13, 2007 Share Posted December 13, 2007 On my logout.php, it for some reason does not display bottom, while every other page does. <?PHP include('Connect.php'); include('top.php'); $usercheck = addslashes($_POST['username']); $passcheck = md5(addslashes($_POST['password'])); $Result1 = mysql_query("SELECT * FROM users WHERE username='$usercheck' AND password='$passcheck'"); $Rows1 = mysql_fetch_array($Result1); $UserID = $Rows1['ID']; /* if logged in */ if (isset($_COOKIE['UserID'])) { setcookie("UserID", "$UserID", time() - 9999999); echo "You are now logged out, go to <a href='index.php'> Home</a> to log back in."; exit; } /* if logged out */ if (!isset($_COOKIE['UserID'])) { echo "Sorry, you are already logged out. Click <a href='index.php'>Here</a> to go back."; include("bottom.php"); exit; } ?> Whats wrong? Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted December 13, 2007 Share Posted December 13, 2007 try this.... <?PHP include('Connect.php'); include('top.php'); $usercheck = addslashes($_POST['username']); $passcheck = md5(addslashes($_POST['password'])); $Result1 = mysql_query("SELECT * FROM users WHERE username='$usercheck' AND password='$passcheck'"); $Rows1 = mysql_fetch_array($Result1); $UserID = $Rows1['ID']; /* if logged in */ if (isset($_COOKIE['UserID'])) { setcookie("UserID", "$UserID", time() - 9999999); echo "You are now logged out, go to <a href='index.php'> Home</a> to log back in."; exit; } else{ /* if logged out */ echo "Sorry, you are already logged out. Click <a href='index.php'>Here</a> to go back."; include("bottom.php"); exit; } ?> Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 13, 2007 Author Share Posted December 13, 2007 I did that, and it works. Also, If I log out, them I go to /logout.php again, it displays the 'You are now logged out page'. Help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.