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. Quote Link to comment Share on other sites More sharing options...
aruns Posted February 23, 2008 Share Posted February 23, 2008 try it $ip = $_SERVER['REMOTE_ADDR']; Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.