Need help on $_SERVER['HTTP_HOST'] and php code
Posted: Wed May 12, 2004 9:21 pm
Hi,
I am trying to use the $_SERVER['HTTP_HOST'] , to show html at the top of the page. (for every "parked" name on my server points only to one website but when someone goes on the site and types in for ex. yahoo.com, or excite.com thats what shows up at the top, ONLY it has to be in html so i can change the look of it)
OK here is the code:
Thats what i got so far.. Also, instead of writing out all sub-domains, can I use for ex. "*.yahoo.com"?? (will it still work if someone just types in "yahoo.com"?)
Thank you in advance.
[/php_man]
I am trying to use the $_SERVER['HTTP_HOST'] , to show html at the top of the page. (for every "parked" name on my server points only to one website but when someone goes on the site and types in for ex. yahoo.com, or excite.com thats what shows up at the top, ONLY it has to be in html so i can change the look of it)
OK here is the code:
Code: Select all
<?
/// Start Settings ////
$yahoo='<b><font style="FONT-SIZE: 24pt" face="Verdana"><font color="#000080">
Yahoo</font><i><font color="#ff0000">.com</font></i></font></b>';
$excite='<b><font style="FONT-SIZE: 24pt" face="Verdana"><font color="#000080">
Excite</font><i><font color="#ff0000">.com</font></i></font></b>';
/// End Settings ////
/// List Functions
if($_SERVER['HTTP_HOST'] == "yahoo.com" OR "www.yahoo.com" OR "tv.yahoo.com" OR "mail.yahoo.com")
{
print($yahoo);
}
else if($_SERVER['HTTP_HOST'] == "excite.com" OR "www.excite.com" OR "tv.excite.com" OR "weather.excite.com")
{
print($excite);
}
/// If nothing is privided we will display the below message
else
{
echo ( "Wrong Parameters" );
}
?>Thank you in advance.
[/php_man]