Jump to content

Storing Remote_Addr To Database


SandySynaptik

Recommended Posts

I want a webpage that whenever a user visits that webpage it track/store its IP address and the time of the visit to the database. I think emailing the whole thing would be more easier than storing into database.

Link to comment
Share on other sites

Hmm, well easy storing into a database too. You can make a table with columns like id, ip_address, time and store each visitors ip and time in those columns. To make it more simple, and if you're wondering what data type to use for ip_address column, you can use varchar. You can use the $_SERVER['REMOTE_ADDR']; and the now() function in MySQL when inserting(querying) into a database each time a user visits. If you want, you can also email it to you too along with storing into a database/table. :)

Link to comment
Share on other sites

I think it would be kind of annoying to get an e-mail for every single visit to your site. Imagine getting 50 visits a day (which isn't that much)Databases are made to manage these things, e-mail was intended for communication.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...