alconebay Posted August 14, 2008 Share Posted August 14, 2008 I have this http://www.thewebhelp.com/php/php_contact_form_with_image_validation/ script setup and working on my site. However, I would like to change the actual email received so that the IP address shows after the message, not before the message. This is the part that formats the message (as far as I can tell). Whenever I rearrange the "$_SERVER['REMOTE_ADDR']" so its after $message I break the script... mail("$email", 'Puplookup User Question: '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from"); Thanks Quote Link to comment Share on other sites More sharing options...
conker87 Posted August 14, 2008 Share Posted August 14, 2008 Try: mail("$email", 'Puplookup User Question: '.$subject, $message . "/n/n" . $_SERVER['REMOTE_ADDR'], "From: $from"); Quote Link to comment Share on other sites More sharing options...
alconebay Posted August 14, 2008 Author Share Posted August 14, 2008 That almost works. If my message ($message) is "Test." I get this email back: Test./n/n66.135.29.186 Those "/n/n" are being echoed. What do they do anyway? I also need a line break after the message. Thanks Quote Link to comment Share on other sites More sharing options...
alconebay Posted August 14, 2008 Author Share Posted August 14, 2008 If I change it to this: mail("$email", 'Puplookup User Question: '.$subject, $message . " " . "IP address of sender: " . $_SERVER['REMOTE_ADDR'], "From: $from"); and I resend the form I get this: Test. IP address of sender: 66.135.29.186 Were those \n\n things important? If not, all I need it a suggestion on how to make a line break between the message and ip info. Quote Link to comment Share on other sites More sharing options...
alconebay Posted August 14, 2008 Author Share Posted August 14, 2008 Haha, those "\n" things are a line break. I feel dumb. Changing the line to below did the trick: mail("$email", 'Puplookup User Question: '.$subject, $message . "\n\n". "IP address of sender: " . $_SERVER['REMOTE_ADDR'], "From: $from"); How it was formatted: Test. IP address of sender: 66.135.29.186 Thanks for getting me on the right path conker87. Quote Link to comment Share on other sites More sharing options...
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.