![]() |
Help me, I want to set up a PHP redirect file, Thanks
Hi I have a problem,
I want a simple PHP file that only does redirect, I have something made up but doesn't work: <?php switch($id) { case 0: $url = "http://www.yahoo.com"; break; case 1: $url = "http://www.altavista.com"; break; } header("Location: $url"); ?> I named it redirect.php and if I make query http://www.mysite.com/redirect.php?id=0 it takes me to yahoo.com but if I make query http://www.mysite.com/redirect.php?id=1 it takes me to yahoo.com again instead of altavista.com help? |
try this
switch($HTTP_GET_VARS["id"]){ case 0: $url = "http://www.yahoo.com"; break; case 1: $url = "http://www.altavista.com"; break; } header("Location: $url"); ?> |
Quote:
|
Many thanks dacash !!! Works fine now!
Thanks again 10x ! |
no problem, always try to help people out, because someday maybe i'll need some help :)
|
All times are GMT -7. The time now is 09:53 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123