View Single Post
  #2 (permalink)  
Old 06-21-2005, 04:56 PM
jestep jestep is offline
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2004
Location: Austin, TX
Posts: 1,229
jestep RepRank 0
Default

No way to do City or State unless you have an IP location database system. These are out there but they are so big that it is usually a very slow process.

Here's the value for the IP in php.
Code:
$REMOTE_ADDR
Something like this would put each visitor in a database.
Code:
$put_in_db = "INSERT INTO your_table (id, user_ip, date) VALUES ('', '$REMOTE_ADDR', NOW())";
$put_in_res = mysql_query($put_in_db);
This would not display any output, so if there was an error your page would still function properly.
Reply With Quote