PDA

View Full Version : Conditional based on domain name


fastlaneweb
02-23-2008, 03:51 AM
Hi there,
I am working to semi-combine two forums while keeping separate identities at the same time. First, let me say I have licenses for both sites.

What phrase would I need to use to detect the domain name of the site so I can display different forums, styles, templates, etc.

I'm thinking it would be something like


<if condition="((THIS_DOMAIN == 'mydomain1.com') >
display page 1
<if condition="((THIS_DOMAIN == 'mydomain2.com') >
display page 2

<else />
Display something else.
</if>


Would this work? I'm about to try it but I'm not sure what phrase would actually check the domain. I made up this_domain based on this_script.

Thanks!

Dismounted
02-23-2008, 04:52 AM
Use: $_SERVER['HTTP_HOST']

fastlaneweb
02-23-2008, 06:16 AM
Thanks, this works perfectly!