Scud Posted May 20, 2008 Share Posted May 20, 2008 hey, im making a quick site that uses php. i basically need to know how to get my php script to get the ip address of the user and then dump it in my database. basically because its a private site, so i need to make sure that all the data entered in the database has been entered by one other person only. so using ip's to check whether it was the same computer is what i need to do! anyideas? Link to comment https://forums.phpfreaks.com/topic/106428-get-ip/ Share on other sites More sharing options...
beboo002 Posted May 20, 2008 Share Posted May 20, 2008 to get ip address use $ip = $_SERVER['REMOTE_ADDR']; Link to comment https://forums.phpfreaks.com/topic/106428-get-ip/#findComment-545532 Share on other sites More sharing options...
Scud Posted May 20, 2008 Author Share Posted May 20, 2008 and how do i call that variable and dump it in the tabe. the code above simply puts their ip and the variable ip Link to comment https://forums.phpfreaks.com/topic/106428-get-ip/#findComment-546131 Share on other sites More sharing options...
realjumper Posted May 20, 2008 Share Posted May 20, 2008 $query = "INSERT INTO your_table (ip_address) VALUES ('$ip')"; mysql_query($query); Link to comment https://forums.phpfreaks.com/topic/106428-get-ip/#findComment-546140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.