Can i use PHP to identify the domain of the site the page is currently on?
What would I use?
Printable View
Can i use PHP to identify the domain of the site the page is currently on?
What would I use?
yes. you can use $_SERVER['HTTP_HOST'] to determine the domain. this will either be "domain.com" or "www.domain.com" or "subdomain.domain.com" (depending on which request you sent using the browser).
Thanks It works quite well.