timmah1 Posted February 4, 2009 Share Posted February 4, 2009 On certain pages, if you're not logged in, my page forces you to the login page with a ref tag, so when you login, it automatically takes to the page you were on. For some reason, this is not working, it's always going to the default. Here is what's on the top of the page $id = $_GET['id']; if(isset($_SESSION['SESS_LOGGEDIN']) == FALSE){ header("Location: " . $config_basedir . "login.php?error=1&ref=review&id=$id"); } Then my login code if($loginrow['active'] == 1){ $_SESSION['SESS_LOGGEDIN'] = 1; $_SESSION['SESS_USER'] = $loginrow['id']; $_SESSION['SESS_EMAIL'] = $loginrow['email']; $_SESSION['SESS_LEVEL'] = $loginrow['level']; switch($_GET['ref']) { case "review": header("Location: " . $config_basedir . "write.php?id=$_GET[id]"); break; default: header("Location: " . $config_basedir . "main.php"); break; } } Can anybody see why it always go to the dafault? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/143723-reference-link-with-login/ Share on other sites More sharing options...
timmah1 Posted February 4, 2009 Author Share Posted February 4, 2009 Does anybody see why this always go to default? Link to comment https://forums.phpfreaks.com/topic/143723-reference-link-with-login/#findComment-754110 Share on other sites More sharing options...
uniflare Posted February 4, 2009 Share Posted February 4, 2009 if the top code was a.php, and the 2nd b.php, if i visited a.php it would send me to b.php and would then be sent to review. there must be something else, try var dump the $_GET array: echo("<pre>"); var_dump($_GET); echo("</pre>");// DEBUG LINE TO SEE WHAT IS INSIDE _GET switch($_GET['ref']) { Link to comment https://forums.phpfreaks.com/topic/143723-reference-link-with-login/#findComment-754153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.