celcon Posted May 29, 2004 Posted May 29, 2004 Hi, How can I capture a visitors IP when they are sending me a message using the contact form? Thanks.
Guest Posted May 29, 2004 Posted May 29, 2004 You can do it like this in contact_us.php: ? if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {? ? $name = tep_db_prepare_input($HTTP_POST_VARS['name']); ? ? $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); ? ? $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); ? ? $ip_address = 'IP Address: ' . getenv("REMOTE_ADDR"); ? ? if (tep_validate_email($email_address)) { ? ? ? tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry . "\n\n" . $ip_address, $name, $email_address); Matti
Recommended Posts
Archived
This topic is now archived and is closed to further replies.