Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

contact form


celcon

Recommended Posts

Posted

Hi,

 

How can I capture a visitors IP when they are sending me a message using the contact form?

 

Thanks.

Posted

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

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...