Jump to content

[SOLVED] Changing Email Script's Message Area


alconebay

Recommended Posts

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

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.

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.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.