Results 1 to 3 of 3
Thread: how to get IPaddress and time?
Dec 7, 2010, 03:11 #1
how to get IPaddress and time?
I want to display to the users, from which IPaddress and what time the user login and last visit time...
I know how to get IPaddress, but how to get the time at the user been login?
and also, when a guest clicks on the link, i want to increment the count to + 1.
If the same guest(means from same IP address) clicks more than once, i want to check the time interval between two clicks say 10 min, and then i want to increment..
For that purpose, i want to know the IP address as well as current time.
Can any one help me regarding this?
Dec 7, 2010, 03:16 #2
To get the time you can use php's time functions
I suggest that you store the time in a cookie http://php.net/manual/en/function.setcookie.php . When a user comes to your site, check if a cookie exists, if it does, compare the time stored in the cookie to the current time.
Dec 7, 2010, 03:19 #3
- Join Date
- Oct 2006
- Kathmandu, Nepal
- 0 Post(s)
- 0 Thread(s)
And for handling the date time see the date() function.
And to store the date/time, as suggested earlier, use setcookie function.