Thanks for your reply.
"So, you have a page set up, so that when you go to it with no referrer, it shows the page as normal. But if you visit the page with a referrer, it will automatically redirect you to another page... Correct?"
Yes, that is how the code works now. It already works fine like that.
Although what I'm wanting to know is, when the user is redirected (if they have a referer) just like how it works now. When they get to the next page (the redirected page) is it possible to setup the same script but, in an opposite manner. So, on the next page (the redirected) page there is a code that will keep them on this page if there IS a referer and if there is no referer it will redirect them to another webpage.
So, I'm wanting to setup the same type of code on the redirected page as on the 1st page but, in reverse.. does that make sense?
Quote:
Originally Posted by Jaryth000
First off, not sure why you set the $random, when you end up just using the formula later on...
At any rate. So, you have a page set up, so that when you go to it with no referrer, it shows the page as normal. But if you visit the page with a referrer, it will automatically redirect you to another page... Correct?
PHP Code:
<?php if($_SERVER['HTTP_REFERER'] = "") { $aff_array = array("http://www.website1.com", "http://website2.com", "http:/website3.com"); header("Location: ".$aff_array[rand(0,2)]); exit(); } ?>
With the above code, if there was NO Referrer it would direct them to another page. However if there was a referer it would show the HTML after the PHP script. Is that what you where looking for? (Note all I really did was change the NOT EQUAL to (!=) to EQUAL (=).)
|
|