+ Reply to Thread
Results 1 to 2 of 2

Thread: Want to Know How to get the IP Address sent in your FORM?
      
   

  1. #1
    wgreene is offline Sergeant Major
    Join Date
    Sep 2005
    Location
    Missouri
    Posts
    89

    Default Want to Know How to get the IP Address sent in your FORM?

    So many people have helped me so I thought I would do the same for others after getting help from Navaldesign. Getting the IP address can be important for many reasons, mostly to prevent unethical behavior and to prevent fraud. If you want to get the IP address, and browser info from those who fill out your forms, heres what you do. In your form you must add the following input field similiar to:

    <input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_USER,REM OTE_ADDR">

    just add this line in between similiar lines which might include your redirect page or required fields.

    Next open up your form script and look for the code below and make sure it looks like this:

    // if the env_report option is on: get eviromental variables
    if ($env_report) {
    $env_report = ereg_replace( " +", "", $env_report);
    $env_reports = split(",",$env_report);
    $content .= "\n------ eviromental variables ------\n";
    for ($i=0;$i<count($env_reports);$i++) {
    $string = trim($env_reports[$i]);
    if ($env_reports[$i] == "REMOTE_HOST")
    $content .= "REMOTE HOST: ".$_SERVER['REMOTE_HOST'] ."\n";
    if ($env_reports[$i] == "REMOTE_USER")
    $content .= "REMOTE USER: ". $_SERVER ['REMOTE_USER'] ."\n";
    if ($env_reports[$i] == "REMOTE_ADDR")
    $content .= "REMOTE ADDR: ". $_SERVER ['REMOTE_ADDR'] ."\n";
    if ($env_reports[$i] == "HTTP_USER_AGENT")
    $content .= "BROWSER: ". $_SERVER ['HTTP_USER_AGENT'] ."\n";
    }
    }

    Now for an easy to use script that this works with, try http://www.scriptarchive.com/download.cgi?s=formmail
    Download and follow the instructions exactly! Hope this helps someone!

  2. #2
    Marc Sanders's Avatar
    Marc Sanders is offline Second Lieutenant
    Join Date
    Mar 2006
    Location
    UK, Southampton
    Posts
    103

    Default Re: Want to Know How to get the IP Address sent in your FORM?

    superb, much needed information - cheers dude!

    Marc

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49