Can't get User's IP
Posted: Mon Sep 08, 2003 7:32 am
I trying to get the user's IP address as they submit their name and email address to my newsletter. Here's my code
I keep getting the IP address for the server instead of the user. Any idea?
Code: Select all
<?php
$p_name = trim(strip_tags($_POSTї'firstname']));
$p_email = trim(strip_tags($_POSTї'email']));
$message = 'This is a notice of a new subscriber to "Internet Marketing Brief"'."\n\n";
$message .= 'NAME='.$p_name."\n";
$message .= 'EMAIL='.$p_email."\n";
$message .= 'IP='.$_SERVERї'REMOTE_ADDR']."\n";
$message .= 'DATE='.date('m-d-Y');
mail('eric@omicentral.com', 'New subscriber', $message, 'FROM:subscribe@omicentral.com');
?>