Re: Problem with the HTTP_REFERER

From: Date: Fri, 27 Apr 2001 12:03:03 +0000
Subject: Re: Problem with the HTTP_REFERER
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50599@lists.php.net to get a copy of this message
Thanks very much !!! Rosen Marinov "Simon Ould" <Simon@nortechcontrol.co.uk> wrote in message news:511B289BD436D41199AE0001021A9B5E05C5AB@SERVER... > My interpretation of the problem is: > You want a link on page A.php which points to B.php, > B.php does some stuff, then redirects the user to page C.php > > You want the value of HTTP_REFERER on page C.php to be A.php > > Correct? If so, read on, if not, then delete this email. > > I'm using php-4.0.4pl1, apache 1.3.14, IE5.5, win2000, and this works on my > system. > > My two solutions both use the following 2 files : > [index.html] > <HTML> > <HEAD> > <TITLE>Test</TITLE> > </HEAD> > <BODY> > <A HREF="test.php" target="_blank">Click here</A> > </BODY> > </HTML> > > [targetpage.php] > <HTML> > <HEAD> > <TITLE>targetpage.php</TITLE> > </HEAD> > <BODY> > You came to this page from "<?php echo $HTTP_REFERER;?>" > </BODY> > </HTML> > > > Solution 1: > Use the php function "header" > (http://www.php.net/manual/en/function.header.php) > > [test.php] > <?php > //... do stuff > $web= "http://localhost/referer_test/targetpage.php"; > header ("Location: ".$web); > ?> > > ------------------- > Solution 2: > Pass HTTP_REFERER in the URL: This also works on my system, but isn't > exactly the neatest of methods. > > [test.php] > <HTML> > <HEAD> > <TITLE>test.php</TITLE> > </HEAD> > <BODY> > <?php > $web= "localhost/referer_test/targetpage.php"; > $web= $web."?HTTP_REFERER=".$HTTP_REFERER; file://pass HTTP_REFERER > in the URL > echo "<SCRIPT > > language=\"javascript\">window.location.href=\"http://$web\"</script>"; > ?> > </BODY> > </HTML> > > > > > Hope that helped, > > Simon. > > > -----Original Message----- > > From: Rosen [mailto:rosen_dm@dir.bg] > > Sent: Friday, April 27, 2001 07:56 > > To: php-general@lists.php.net > > Subject: Re: [PHP] Problem with the HTTP_REFERER > > > > > > Is anybody knows how can I redirect to another page > > and the REFERER to another page to be my page ? > > > > Thanks, > > Rosen Marinov > ... snip ... > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#50599) next »