bob950 Posted February 23, 2008 Share Posted February 23, 2008 This is a very simple question. Basically, I downloaded a shoutbox script and put it on my website. The only bad thing is, there is no field that tells you a posters IP address. I added the field in the MySQL database, but do not know the php code to actually retrieve and post the posters IP to the database. I would appreciate any help. Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/ Share on other sites More sharing options...
aruns Posted February 23, 2008 Share Posted February 23, 2008 try it $ip = $_SERVER['REMOTE_ADDR']; Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/#findComment-474249 Share on other sites More sharing options...
drisate Posted February 23, 2008 Share Posted February 23, 2008 You have them all here http://ca.php.net/reserved.variables Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/#findComment-474255 Share on other sites More sharing options...
bob950 Posted February 23, 2008 Author Share Posted February 23, 2008 thanks, thats what I needed. But what would the code be to add that to the database? Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/#findComment-474688 Share on other sites More sharing options...
revraz Posted February 23, 2008 Share Posted February 23, 2008 UPDATE tablename SET ip = '$ip' WHERE id = $id; Change out for your settings. Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/#findComment-474694 Share on other sites More sharing options...
bob950 Posted February 23, 2008 Author Share Posted February 23, 2008 sweet thank you all for the help. Link to comment https://forums.phpfreaks.com/topic/92552-get-ip/#findComment-474736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.