I want to record visitors IP addresses when they visit my site, I was under the impression that $_SERVER[‘REMOTE_ADDR’] would do the trick but this returns the same IP regardless of who visits. Does anyone know why and have an alternative solution?
@b_hunterApr 22.2007 — #How would the poster being behind a proxy stop the poster from viewing an ip address of someone else? I thought that if I proxy were to be used in this case, it would be the visitor using a proxy, thus, stopping the poster from seeing the visitor's ip address. Is that what you meant? I don't know much about proxies, though, so don't get offended. That's why I'm asking.
@ZnupiApr 22.2007 — #Me neither, but I know that proxies usually create problems with $_SERVER['REMOTE_ADDR']. I don't know if it is only the case of the user being behind the proxy, the server, or both, it was just a suggestion.
@NogDogApr 22.2007 — #Use an alias for the count(): [code=php] $query = "SELECT fldPostUID, COUNT(fldCommentUID) AS num_comment FROM msBlogComments GROUP BY fldPostUID ORDER BY num_comment"; [/code]
@SolaarauthorApr 23.2007 — #Thanks NogDog, nice and easy. Sheldon that drew a blank i'm afraid - doesn't fetch anything. You're right about $_SERVER['REMOTE_ADDR'] returning my servers ip though. I fear I have a more deep-rooted problem. Thanks for the help.
@mrtbltDec 10.2007 — #On the beginning of my index.php file, i inserted the following code to track the visitors who visit my website. But obviously, anytime when they return to the index page, the following code makes a recurring record. So how may i avoid this recurring recording each time when the visitor returns to the index page?
$clientip= $_SERVER['REMOTE_ADDR'];
$tarih = date('Y.m.d');
mysql_query("INSERT INTO visitors VALUES('$clientip','$tarih')") or die(mysql_error()); [/QUOTE]