Guest johndirk Posted February 18, 2010 Report Share Posted February 18, 2010 hi i made a email form and everything works ok but i want get the ip address from the visitors on my form. i made variable: $ip = $_POST['ip']; but i dont know how can i get the ip address? thanks Quote Link to comment Share on other sites More sharing options...
krillz Posted February 18, 2010 Report Share Posted February 18, 2010 (edited) you would have to do: $ip = $_SERVER['REMOTE_ADDR']; this will give you the clients current ip adress while visiting your site, however do concider the fact that most poeple do not have static IP adresses but dynamic. So if you are concidering doing a validation or auth script based on the client's IP adress alone this could cause a lot of trouble to the users having dynamic adresses. but I assume you are just using it to log the user. Edited February 18, 2010 by krillz 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.
Note: Your post will require moderator approval before it will be visible.