Jump to content

Recommended Posts

Posted (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 by miner2049er
Posted (edited)

Maybe you could use javascript to retrieve it?

><script language="javascript">var thisdomain;
thisdomain = window.location.host;</script>

Edited by Steve Scrimpshire
Posted (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 by miner2049er

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...