yana Posted July 10, 2006 Share Posted July 10, 2006 I am using the following two methods now to capture above mentioned info:$ip_address = $_SERVER['REMOTE_ADDR'];$user_browser = $_SERVER['HTTP_USER_AGENT'];This user info is captured and sent in an email to me and works perfectly on our Test Server. However, on the Live Server this does not get captured (I get an email with a blank).What could be the cause of this??? Link to comment https://forums.phpfreaks.com/topic/14212-capturing-ip-address-and-browser-info/ Share on other sites More sharing options...
.josh Posted July 10, 2006 Share Posted July 10, 2006 show the rest of the code that it is in. Link to comment https://forums.phpfreaks.com/topic/14212-capturing-ip-address-and-browser-info/#findComment-55745 Share on other sites More sharing options...
yana Posted July 10, 2006 Author Share Posted July 10, 2006 <html><body><?$ip_address = $_SERVER['REMOTE_ADDR'];$user_browser = $_SERVER['HTTP_USER_AGENT'];//add From: header $headers = "From: \"Online Survey\" webserver@localhost\r\n";//specify MIME version 1.0 $headers .= "MIME-Version: 1.0\r\n"; //unique boundary $boundary = uniqid("HTMLDEMO"); //tell e-mail client this e-mail contains//alternate versions $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n"; //message to people with clients who don't understand MIME $headers .= "This is a MIME encoded message.\r\n\r\n"; //HTML version of message $headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode("IP Address: $ip_address Browser: $user_browser"))//send message mail("[email protected],[email protected]", "Online Survey", "", $headers); ?> </body></html> Link to comment https://forums.phpfreaks.com/topic/14212-capturing-ip-address-and-browser-info/#findComment-55751 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.