vikaspa Posted April 22, 2009 Share Posted April 22, 2009 dear All I have typical problem here refer http://www.ethnicjewel.in/subcategory.php?cid=13 one can login using following details user : [email protected] password 12345678 and wel come etc details appears when I click on logout it logs out perfectly fine but the page cannot be displayed properly as its parameter for query is nullified and we get following error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 when i saw address ontop it was http://www.ethnicjewel.in/subcategory.php and not http://www.ethnicjewel.in/subcategory.php?cid=13 can we avoid this ? script in loout.php <?php session_start(); session_unregister('Username'); session_unregister('UserGroup'); unset($_SESSION['Username']); unset($_SESSION['UserGroup']); $loginstatus = 0; $logoutGoTo = $_SESSION['referpage']; header("Location: $logoutGoTo"); ?> I noticed that the $logoutGoTo has correct page value but the parameter for the query is null Link to comment https://forums.phpfreaks.com/topic/155203-retain-the-same-page-after-logout/ Share on other sites More sharing options...
jackpf Posted April 22, 2009 Share Posted April 22, 2009 Why not only run the query if $_GET['cid'] is set? Otherwise, echo something like "you need to select a subcat"? Link to comment https://forums.phpfreaks.com/topic/155203-retain-the-same-page-after-logout/#findComment-816468 Share on other sites More sharing options...
avvllvva Posted April 23, 2009 Share Posted April 23, 2009 Post your SQL query & content of $_SESSION['referpage'] Link to comment https://forums.phpfreaks.com/topic/155203-retain-the-same-page-after-logout/#findComment-817111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.