abanksob1 Posted February 3, 2010 Report Posted February 3, 2010 HI how do i collect people who fill out form ip address so i can control spam . i am currently is using php form to contact me how ever i want to also add there unique ip address when the form is sent to be here is my file contact.php Contact Us Name: * Phone: * Email: * Your comments: * and here is my send.php <? if (isset($_POST['name']) && !isset($_POST['freequote'])) { $MSG = 'Contact Us: '; $MSG .= (isset($_POST['name']))? 'Name = '.$_POST['name']." " : ''; $MSG .= (isset($_POST['phone']))? 'Phone = '.$_POST['phone']." " : ''; $MSG .= (isset($_POST['email']))? 'Email = '.$_POST['email']." " : ''; $MSG .= (isset($_POST['comment']))? 'Comments = '.nl2br($_POST['comment'])." " : ''; $MSG = " $MSG"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=windows-1255\n"; $headers .= "From: Movers Community \n"; $st = mail('avidanbanks@gmail.com moversleads@gmail.com', 'From website', $MSG, $headers); header('location: thanks.php'); exit(); were do i put a code to collect the person unique ip address and send it to me so i can see who is on my site ? please advise Quote
Guest Dean Posted February 3, 2010 Report Posted February 3, 2010 Hi, $_SERVER['REMOTE_ADDR'] This picks up the IP address of the user sending the form. Here's how you can add it to your script, find this part: $st = mail('avidanbanks@gmail.com moversleads@gmail.com', 'From website', $MSG, $headers); Change it to: $subject = "From Website: ".$_SERVER['REMOTE_ADDR']; $st = mail('avidanbanks@gmail.com moversleads@gmail.com', $subject, $MSG, $headers); Dean HIhow do i collect people who fill out form ip address so i can control spam . i am currently is using php form to contact me how ever i want to also add there unique ip address when the form is sent to be here is my file contact.php Contact Us Name: * Phone: * Email: * Your comments: * and here is my send.php <? if (isset($_POST['name']) && !isset($_POST['freequote'])) { $MSG = 'Contact Us: '; $MSG .= (isset($_POST['name']))? 'Name = '.$_POST['name']." " : ''; $MSG .= (isset($_POST['phone']))? 'Phone = '.$_POST['phone']." " : ''; $MSG .= (isset($_POST['email']))? 'Email = '.$_POST['email']." " : ''; $MSG .= (isset($_POST['comment']))? 'Comments = '.nl2br($_POST['comment'])." " : ''; $MSG = " $MSG"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=windows-1255\n"; $headers .= "From: Movers Community \n"; $st = mail('avidanbanks@gmail.com moversleads@gmail.com', 'From website', $MSG, $headers); header('location: thanks.php'); exit(); were do i put a code to collect the person unique ip address and send it to me so i can see who is on my site ? please advise Quote
Recommended Posts
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.