HTTP_REFERER and Redirection

From: Date: Wed, 08 Nov 2000 02:13:43 +0000
Subject: HTTP_REFERER and Redirection
Groups: php.general 
Request: Send a blank email to php-general+get-24239@lists.php.net to get a copy of this message
Hello all, I am having two files by named scene1.php and scene2.php. The scene2 file got links to two other files which are named first.php and second.php. I tried to explain as much as clear as i can what i am trying to do with the scene2.php: Whenever the user clicks on the first link in scene2.php that will be directed to the first.php and will get redirected to scene2.php after 3 seconds and that particular links will get delinked so that the user can not go to first.php once again. So now the user clicks on the second link and gets redirected back to scene2.php and that link also will gets delinked. Here is the piece of code which i am trying to make this work. -------------------------------------- if ($HTTP_REFERER == "http://myhost.com/scene1.php") { print ("<a href=http://myhost.com/first.php>Go to first page</a>"); print ("<a href=http://myhost.com/second.php>Go to second page</a>"); } elseif ($HTTP_REFERER == "http://myhost.com/first.php") { print ("Go to first page"); print ("<a href=http://myhost.com/second.php>Go to second page</a>"); } else { print ("Go to first page"); print ("Go to second page"); } --------------------------------------- I tried *several* ways apart from the above logic, but in all of them the middle part of code is not functional, so either both the lines are linked or none of them is linked. Is this got to do with logic or with the redirection i am using. TIA Chakravarthy K Sannedhi

« previous php.general (#24239) next »