Jump to content

ip address email form


Guest johndirk

Recommended Posts

Guest johndirk

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

Link to comment
Share on other sites

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 by krillz
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...