help with this code...
Posted: Mon Jan 12, 2004 9:32 pm
Hey, for some reason theres a problem with this. What i'm doing is i have a few DDNS domains setup for my one IP address, and i made an index.php file that is always called from all the addresses, then it parses the header, and send them to the right directory...
I had it working with ASP, but decided to recode it in PHP, and it works, but only if i enter http://www. infront of it, if i jsut enter the address it wont work... but i think it should.. anyways....
I was just using >1, so i chaged it to >0 and it still wasn't working.
I've also tried ===true, but htat didn't work either...
Help Please!!
I had it working with ASP, but decided to recode it in PHP, and it works, but only if i enter http://www. infront of it, if i jsut enter the address it wont work... but i think it should.. anyways....
Code: Select all
<?php
$x=strtolower($_SERVER["HTTP_HOST"]);
If(strpos($x,'this')>0)
header("Location: /this");
else if(strpos($x,'that')>0)
header("Location: /that");
else if(strpos($x,'what')>0)
header("Location: /what");
else echo "error! ".$x;
?>I've also tried ===true, but htat didn't work either...
Help Please!!