Jump to content

$referrer


aeafisme23

Recommended Posts

Description:

Im at yahoo.com, i type in mydomain.com in address bar. i want the user to be redirected to their last current page they were on (yahoo.com).

Im doing this so they have to go through my site to that certain page rather than type the exact url into addressbar.

Here is what i got so far:

[code]
/* Error Checking, if state or city does not exist, then go back to Original URL ... so if you came from Yahoo, go back to Yahoo */
if ($state == "" || $city =="") {
$URL=$referrer;
header ("Location: $URL");
}

/* Error Checking, if here then just do that simple echo more programming would be inserted with includes and what not
/* RICHMOND, VIRGINIA: WTVR AND MATTRESS WAREHOUSE*/
elseif ($state == "VA" && $city =="Richmond-Petersburg"){

echo "hi ur from Virginia, Richmond area";}

/* Error Checking, this is an else just because who knows what might happen , but hey lets send them back to Yahoo if thats where they came from
else {
$URL=$referrer;
header ("Location: $URL");
}
?> [/code]

Everything works except for the fact that it redirects back to the [a href=\"http://www.domain.org/\" target=\"_blank\"]http://www.domain.org/[/a]video/INDEX.PHP not back to say AMAZON or ebay wherever a person is entering the link from. Any ideas? Thanks guys
Link to comment
Share on other sites

Simplified Version:

Im at yahoo.com, i type in mydomain.com in address bar. i want the user to be redirected to their last current page they were on (yahoo.com).

Im doing this so they have to go through my site to that certain page rather than type the exact url into addressbar.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.