/    Sign up×
Community /Pin to ProfileBookmark

Reveal visitor’s ip address

I am working on a page for a big celebrity auction – and they want to have verbiage showing that the visitor’s Ip address has been captured so that they can prosecute if someone prints down copyrighted pictures. I need to capture it to a text file in my _private folder. Any ideas?

I used this script (scare tactics only) and what keeps coming up on the screen is:
<!–#echo var=”REMOTE_ADDR”–> instead of Your IP Address is: 000.00.000.00 – or whatever….

This is the code I used – can you tell me where I went wrong?

<!– ONE STEP TO INSTALL IP ADDRESS:

  • 1. Copy the coding into the HEAD of your HTML document –>
  • <!– STEP ONE: Paste this code into the HEAD of your HTML document –>

    <SCRIPT LANGUAGE=”JavaScript”>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– Begin
    // [url]http://www.kdcgrohl.com[/url]

    // Depending on your server set-up,
    // you may need to use the “.shtml”
    // extension [instead of the “html”
    // or “htm”] as the script uses Server
    // Side Includes. To display in the
    // title bar, exclude the
    //”<title></title>” code from the page.

    // This part gets the IP
    var ip = ‘<!–#echo var=”REMOTE_ADDR”–>’;

    // This part is for an alert box
    alert(“Your IP address is “+ip);

    // This part is for the status bar
    window.defaultStatus = “Your IP address is “+ip;

    // This part is for the title bar
    document.write(“<title>Your IP address is “+ip+”</title>”);
    // End –>
    </script>
    <!– Script Size: 1.09 KB –>
    </HEAD>

    to post a comment
    JavaScript

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @JPnycNov 11.2004 — Javascript isn't what you need. You need a serverside lang. I'm assuming based on the echo statement that your server supports PHP or Perl, so use 1 of those.
    Copy linkTweet thisAlerts:
    @kdaymaydayauthorNov 11.2004 — can you offer a suggestion? or give me the script I need?
    Copy linkTweet thisAlerts:
    @JupacNov 11.2004 — [code=php]<?
    $log_file = "ip.txt";
    $ip = getenv('REMOTE_ADDR');
    $fp = fopen("$log_file", "a");
    fputs($fp, "$iprn");
    flock($fp, 3);
    fclose($fp);
    PRINT("Your Ip was logged.....$ip");
    ?>
    [/code]



    make sure you make a ip.txt file and upload it
    Copy linkTweet thisAlerts:
    @kdaymaydayauthorNov 11.2004 — check this out - it works!

    http://www.daylightweb.com/friends3.html

    Thank you - It didn't capture the ip in the ip.txt - I put it in the root directory....but it did capture it in the _private/results.csv
    ×

    Success!

    Help @kdaymayday spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.6,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...