cabou
asked on
get domain and subdomain
hi experts
I would like to know what domain is my users using.
for exemple:
radio.domain.com
www.domain.com
domain.com
Thanks
I would like to know what domain is my users using.
for exemple:
radio.domain.com
www.domain.com
domain.com
Thanks
ASKER
this is not working.... it returns the full url
radio.domain.com/123765/12 637 instead of only radio.domain.com
radio.domain.com/123765/12
You tried $_SERVER['HTTP_HOST'] too?
I used it many times and never let me down.
But if you still get the long version, you should use an explode with "/" and save only the first element.
I used it many times and never let me down.
But if you still get the long version, you should use an explode with "/" and save only the first element.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try $_SERVER['SERVER_NAME'] or $_SERVER['HTTP_HOST'].
It should do it.