Jump to content

If else statement with $_server


osf2008

Recommended Posts

doesnt this have to be in quotes?

 

well it wont work because your if statment only has one = not two so it is setting the variable,

 

try

 

if ($_SERVER['SERVER_NAME'] == "www.sitea.com")
{
$maintext = "Site A text"
}
else
{
$maintext = "Site B text"
}

 

and please next time use the [ code ] [/ code ] tags

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.