miner2049er Posted August 12, 2006 Posted August 12, 2006 (edited) I'm hosted by TCH on a shared server, and currently I have my domain name simobile.com parked on top of foothillsforum.com Is there any way I can detect through code in my index.php file that someone had got there by typing in simobile.com rather than foothillsforum.com, or can I never detect? Currently in my PHP code, all I ever get returned to me in variables such as $_SERVER['SERVER_NAME'] is foothillsforum.com - I want to know if somebody had used simobile.com to get to the site. In the address bar pages do show up as either www.simobile.com/blahblah or www.foothillsforum.com/blahblah depending on what was used. Thanks for any any advice! Edited August 12, 2006 by miner2049er Quote
TCH-Rick Posted August 12, 2006 Posted August 12, 2006 You should be able to check AWStats for either domain to see how many are accessing the sites using the domains. Quote
Steve Scrimpshire Posted August 13, 2006 Posted August 13, 2006 (edited) Maybe you could use javascript to retrieve it? ><script language="javascript">var thisdomain; thisdomain = window.location.host;</script> Edited August 13, 2006 by Steve Scrimpshire Quote
TCH-Don Posted August 13, 2006 Posted August 13, 2006 Maybe getenv("HTTP_REFERER"); would work? Quote
carbonize Posted August 13, 2006 Posted August 13, 2006 Try this to see what you get <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?> See what results you get. Quote
miner2049er Posted August 14, 2006 Author Posted August 14, 2006 (edited) Try this to see what you get <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?> See what results you get. Aha! Everything returned was the same, except for [HTTP_HOST] which gave me either simobile.com or foothillsforum.com, depending on what I had entered in the address bar. Thanks to everyone for all your replies. Cheers, Miner2049er. Edited August 14, 2006 by miner2049er Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.