Jump to content

get domain they are viewing the website from


djanim8

Recommended Posts

Here's what I use  (it works most of the time):

<?php
	if ($_SERVER["HTTP_X_FORWARDED_FOR"] != ""){
        		$IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
        		$proxy = $_SERVER["REMOTE_ADDR"];
        		$host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]);
	}else{
        		$IP = $_SERVER["REMOTE_ADDR"];
        		$host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]);
	}
echo "Remote host is $host<br>";
?>

 

Ken

Link to comment
Share on other sites

ok I've checked out samspade.org and I get tons of info when I actually type in an IP.. but when I put a link in the code to try to strip apart the code and get the domain, it says this:

 

That information isn't in the cache

 

For example, tried getting it with this: http://samspade.org/whois/74.6.25.34

 

is there another link that would display in the data so I can read it? like http://samspade.org/whois/?ip=

 

or something?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.