Re: [PHP] Conditional include based on virtual host ?

2001-01-27 Thread Markus Fischer


You could use $HTTP_HOST:

if( stristr( $HTTP_POST, "fr.domain.com"))
$lang = "fr";

Just put such in your settings.php file you allready include.
Works for me.

Any other ideas very welcome too :)

m.

-- 
Markus Fischer,  http://josefine.ben.tuwien.ac.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public  Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Conditional include based on virtual host ?

2001-01-26 Thread Alain Fontaine

Hello,

I have developed a large web application the contents of which (language and
data) depends on the URL the site is accessed from, e.g. en.site.com would
display the "english" site, and "fr.site.com" would display the french site,
and so on.

The whole thing is "parameterized" through a set of global variables (or
defines) that reside in a file called settings.php. The question is: how can
I include the "right" settings.php file, depending on the virtual host used
to access the site? This is an Apache server on Linux, and I thought setting
the "include_path" for every virtual host in the vhosts section of
httpd.conf would maybe do the trick ?

Thanks !



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Conditional include based on virtual host ?

2001-01-26 Thread Richard Lynch

Should work, I think.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: "Alain Fontaine" [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:36 AM
Subject: [PHP] Conditional include based on virtual host ?


 Hello,

 I have developed a large web application the contents of which (language
and
 data) depends on the URL the site is accessed from, e.g. en.site.com would
 display the "english" site, and "fr.site.com" would display the french
site,
 and so on.

 The whole thing is "parameterized" through a set of global variables (or
 defines) that reside in a file called settings.php. The question is: how
can
 I include the "right" settings.php file, depending on the virtual host
used
 to access the site? This is an Apache server on Linux, and I thought
setting
 the "include_path" for every virtual host in the vhosts section of
 httpd.conf would maybe do the trick ?

 Thanks !



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]