Log in

View Full Version : get IP address from contact form?


lukemax
01-22-2007, 07:55 PM
I was wondering, it might be beneficial if I were to know a few additional things when people use my contact form, like their IP address. So can I use this code to get that data and how do I put it in the form?

$ipi = getenv("REMOTE_ADDR");
then place the hidden field inside the html form

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
Thanks...
(then how do i put this in the email I recieve?
(The IP address used here was: ____.____.____.____)