Forum Moderators: coopster

Message Too Old, No Replies

Tracking IP address?

PHP form question

         

texignweb

1:58 am on Jun 23, 2005 (gmt 0)

10+ Year Member



When someone completes a form I want to be able to view their IP address in the email sent to me.

Is their some kind of simple script I can use for this?

Thanks in advance.

raulwg

2:06 am on Jun 23, 2005 (gmt 0)

10+ Year Member



I did al little research for ya, just typed it in Google and it came up with this site:

<snipped url ( search for "free php hit counter script" ) >

I hope it does the job!

Raúl

[edited by: coopster at 10:15 am (utc) on June 23, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

texignweb

2:44 am on Jun 23, 2005 (gmt 0)

10+ Year Member



Thank you for the link. I know very little about php but I think the script on that page I was looking for is

$ip=getenv(REMOTE_ADDR);

I'm guessing that is the variable/string whatever. Now, do I place that somewhere in the form and in the email just use the '$ip' to display the IP?

coopster

10:08 am on Jun 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



PHP offers quite a few predefined variables. Note that not all $_SERVER [php.net] variables will be available, it often depends on your server setup. The one you are currently after is quite reliable though, especially on Apache installations.