Recognize Redirect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Istvan
Forum Newbie
Posts: 2
Joined: Tue Aug 09, 2005 7:12 am
Location: Austria

Recognize Redirect

Post by Istvan »

If want to Recognize redirection.

User type manually *.info into the browser and are redirected
to *.com

How can i regonize that the User came from *.info ???
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Depending on how they are redirected, this should work.

Code: Select all

<?php
$come_from = $HTTP_REFERER;
?>
User avatar
Istvan
Forum Newbie
Posts: 2
Joined: Tue Aug 09, 2005 7:12 am
Location: Austria

Post by Istvan »

you mean $_SERVER['HTTP_REFERER']; ?

that doesn't work.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You can redirect them to: .com/?from=info

And then check in $_GET for the 'from' key.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

If you own both the domain names and you're having the single location for both these domains then you use $_SERVER['HTTP_HOST'] to check for the domain and redirect accordingly.
Post Reply