Thanks, I tried that but I couldn't get it to work.
It only returned "fuckedyourmum.com" without the subdomain.

I used $_SERVER["HTTP_HOST"] instead.

Look at the source if you like...

http://source.fuckedyourmum.com/index.phps



----- Original Message -----
From: "Dennis Moore" <[EMAIL PROTECTED]>
To: "Liam MacKenzie" <[EMAIL PROTECTED]>; "php"
<[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 12:31 PM
Subject: Re: [PHP] subdomain


Grab the $SERVER_NAME environmental variable.  Then parse the variable using
explode on the period in the domain name.  Count the number of elements in
the array.  and selcct the element you want to use

/dkm


----- Original Message -----
From: "Liam MacKenzie" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, September 10, 2002 8:55 PM
Subject: [PHP] subdomain


> G'day everyone,
>
> I have a dilemma...
> I'm running BIND locally, with a wildcard A record.
> That means that if someone goes to http://somebullshit.mydomain.com/
they'll
> get my page up.
>
> What I want to do is catch that subdomain into a variable...  Is there a
PHP
> global that can get that?
> So, if someone goes to http://liam.mydomain.com/, the page will echo
"Hello
> Liam"
>
> Any ideas guys?
>
> Cheers,
> Liam
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to