X9183 Posted December 15, 2007 Share Posted December 15, 2007 I have a PHP application which after vetting, allows users to enter and once entry is granted $_SESSION and HTTP_REFERER are used within the application and all works fine. What I need to capture is the "pre-application" HTTP_REFERER, for the want of a better way of describing it. In order that I can store the information so that I can pass back control at the end of the PHP session. If that is the correct way of returning control. If it is not does anybody know the correct way?? ??? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted December 16, 2007 Share Posted December 16, 2007 start your sessions from the initial vistit and record a session var with the initila url. Quote Link to comment Share on other sites More sharing options...
X9183 Posted December 16, 2007 Author Share Posted December 16, 2007 Hi, Thanks for the suggested solution; But as you will see from my coding I have already tried it, What follows is the coding for the initial PHP script as you see I have tried capturing the "pre application" HTTP_REFERER info. It could very well be that I am not viewing it correctly <?PHP session_start(); ob_start(); echo('HTTP_REFERER = ' .$_SERVER['HTTP_REFERER']. "<BR>"); $refer = $_SERVER['HTTP_REFERER']; echo('$refer = ' .$REFER. "<BR>"); $_SESSION['entrypoint'] = $_SERVER['HTTP_REFERER']; $entry = $_SESSION['entrypoint']; echo('$entry = ' .$entry. "<BR>"); ?> <HTML><HEAD><TITLE>VALIDATE USER</TITLE></HEAD> <FORM action="check_login.php" id="primary" method="post"><BODY><CENTER><H3>USER VALIDATION</H3></CENTER><HR> <CENTER><TABLE><TBODY><TR><TD>USER NAME:</TD><TD align=left><INPUT maxLength=45 size=50 name="user"></TD></TR> <TR><TD>PASSWORD:</TD><TD align=left><INPUT maxLength=50 size=50 name="passcode"></TD></TR> </TABLE></CENTER> <CENTER><input value="SUBMIT" type="submit"></CENTER><BR><BR><HR> <CENTER>Please check that the information you enter is correct</CENTER> <br></FORM></BODY></HTML> ??? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted December 16, 2007 Share Posted December 16, 2007 $_SESSION['entrypoint'] = $_SERVER['HTTP_REFERER']; change to $_SESSION['entrypoint'] = !isset($_SESSION['entrypoint']) ? $_SERVER['HTTP_REFERER'] : $_SESSION['entrypoint']; Quote Link to comment Share on other sites More sharing options...
X9183 Posted December 17, 2007 Author Share Posted December 17, 2007 Thanks for the help it is very much appriciated. 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.