TheJoey Posted March 28, 2010 Share Posted March 28, 2010 Is there a way to show the link of the previous page you were on. I tried using $_Server['HTTP_REFERER']; completly stuck at the moment Quote Link to comment https://forums.phpfreaks.com/topic/196747-how-to-show-link-on-page/ Share on other sites More sharing options...
TapeGun007 Posted March 28, 2010 Share Posted March 28, 2010 Have you tried adding a quick phpinfo(); to your script to make sure that the hosting web server is actually providing the referer information? Quote Link to comment https://forums.phpfreaks.com/topic/196747-how-to-show-link-on-page/#findComment-1032892 Share on other sites More sharing options...
TheJoey Posted March 28, 2010 Author Share Posted March 28, 2010 session.referer_check no value no value what should i be looking for? Quote Link to comment https://forums.phpfreaks.com/topic/196747-how-to-show-link-on-page/#findComment-1032893 Share on other sites More sharing options...
inversesoft123 Posted March 28, 2010 Share Posted March 28, 2010 Manytime refere information is blocked by webhost or many browsers like KHTML safari/ many mobile/ PDA browsers do not allow referal information. In this case you may use database to store current page of user or u can use PHP GET for previous page function liveURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); } $liveurl = liveURL(); http://www.domain.com/currentpage.php?liveurl=$liveurl ? Quote Link to comment https://forums.phpfreaks.com/topic/196747-how-to-show-link-on-page/#findComment-1032903 Share on other sites More sharing options...
TheJoey Posted March 28, 2010 Author Share Posted March 28, 2010 is there a simpliar way to do that i find that very hard to understand Quote Link to comment https://forums.phpfreaks.com/topic/196747-how-to-show-link-on-page/#findComment-1032928 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.