View Single Post
Old 01-01-2003, 07:08 PM  
AkiraSS
Confirmed User
 
Join Date: Jan 2003
Location: ICQ: 17630227
Posts: 2,988
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?
AkiraSS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote