PDA

View Full Version : How to get the Contact Form Script to add the IP of the user to the email body?


a.champion405576
04-20-2010, 06:38 AM
Hello,

I just bought the Contact Form and I am pleased to recommend it. It is fantastic. I have added new fields, validated them in every sense, just like the originals, and everything is working fine. I even deleted the weekdays-questions from the script because I think visitors from other countries would have trouble spelling Wedndesdady :).

However, in my current HTML form, I have this line:

<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDR,HTTP_REFER ER,DOCUMENT_ROOT,SERVER_NAME">

which returns some information about the user, such as their IP.

Could anyone please please tell me how to add this line to my PHP form, so that the Contact Form returns the IP, the server, the referer, etc.

Thank you in advance for your kind support.

Jason Byrnes
04-20-2010, 07:35 AM
code you hidden element like this:

<input type="hidden" name="env_report" value="REMOTE_HOST: <?php echo((isset($_SERVER["REMOTE_HOST"]))?$_SERVER["REMOTE_HOST"]:"") ?>,HTTP_USER_AGENT: <?php echo((isset($_SERVER["HTTP_USER_AGENT"]))?$_SERVER["HTTP_USER_AGENT"]:"") ?>,REMOTE_ADDR: <?php echo((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"") ?>,HTT P_REFERER: <?php echo((isset($_SERVER["HTTP_REFERER"]))?$_SERVER["HTTP_REFERER"]:"") ?>,DOCUMENT_ROOT: <?php echo((isset($_SERVER["DOCUMENT_ROOT"]))?$_SERVER["DOCUMENT_ROOT"]:"") ?>,SERVER_NAME: <?php echo((isset($_SERVER["SERVER_NAME"]))?$_SERVER["SERVER_NAME"]:"") ?>">

a.champion405576
04-20-2010, 04:16 PM
Thank you Jason for your speedy reply.