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