Help detecting User Details

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inny
    New Member
    • Nov 2007
    • 77

    Help detecting User Details

    Hello, Im trying To create A code In php That Does the Following:

    A. detects visiting users real ip address
    B. detects city and country
    C. detects browser type and version
    D. detects referrer url
    E. detects landing page
    F. appends this information to a txt file

    Im using the following php file hosted in same folder as the txt file, and using

    Code:
    <script src='http://h1.ripway.com/Inny/spy/spy.php'></script>
    in my html.

    txt file
    Code:
    <html>
    <head>
    <title>Spy</title>
    <body background="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif">
    
    </head>
    <body>
    
    <SCRIPT src='http://h1.ripway.com/Inny/spy/pass.js'></SCRIPT>
    
    
    
    <center><font color='red'>
    <form method="POST" action="http://www.geobytes.com/IpLocator.htm?GetLocation">
    <input type="hidden" name="cid" value="0">
    <input type="hidden" name="c" value="0">
    <input type="hidden" name="Template" value="iplocator.htm">
    <h3>IP Address to locate:<input type="text" name="ipaddress" size="15" value=""> <input type="submit" value="Submit">
    </h3>
    </form>
    </center>
    php file

    Code:
    <html>
    <head>
    <title>Spy</title>
    </head>
    <body background="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif">
    <center><h2>
    <center> 
    <table border="5" bg color="white">
    <tr>
    <td><center>
    <body>
    <?php
    $spy = fopen("spy.html" , "a");
    $site = $HTTP_REFERER;
    $ip = $REMOTE_ADDR;
    $browser = $HTTP_USER_AGENT;
    $time = date("H:i dS F");
    
    echo "<font color='red'>The site User came from: " . $_SERVER["HTTP_REFERER"] . "<br />";
    echo "<font color='blue'>ALL IP ADRESSES, TIME, SITE AND USERS BROWSERS ARE BEING CAPTURED!";
    
    fwrite($spy,"<font color='blue'><<<<<------------BEGIN------------>>>>></font><br />");
    fwrite($spy,"<font color='black'>Site user came from: $site <br />");
    fwrite($spy,"IP Address: $ip <br />");
    fwrite($spy,"Browser: $browser <br />");
    fwrite($spy,"Time: $time <br />");
    fwrite($spy,"<font color='red'><<<<<------------END------------>>>>></font><p/><p>");
    
    fclose($spy);
    ?>
    
    </table>
    </center></td>
    </tr>
    </table border>
    </body>
    </html>
    Im getting odd results as all entrys show same ip . please help?
  • Inny
    New Member
    • Nov 2007
    • 77

    #2
    Bizzare results im getting, not what I want

    <<<<<------------BEGIN------------>>>>>
    Site user came from: http://herproom.5.foru mer.com/index.php?
    IP Address: 192.168.0.5
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
    Time: 00:11 26th November
    <<<<<------------END------------>>>>>


    <<<<<------------BEGIN------------>>>>>
    Site user came from: http://herproom.5.foru mer.com/index.php?
    IP Address: 192.168.0.5
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
    Time: 00:15 26th November
    <<<<<------------END------------>>>>>


    <<<<<------------BEGIN------------>>>>>
    Site user came from: http://herproom.5.foru mer.com/index.php?
    IP Address: 192.168.0.5
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
    Time: 00:17 26th November
    <<<<<------------END------------>>>>>

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Maybe it's the same person?

      :P

      Comment

      • Inny
        New Member
        • Nov 2007
        • 77

        #4
        Nothing Useful to add? Its not the same person.
        I think Ive wriiten it wrong and that Ip is the server

        Full-screenYour IP address is 192.168.0.5
        City: Marina Del Rey California
        Country: United States
        Continent: North America
        Time Zone: PST

        Comment

        • Inny
          New Member
          • Nov 2007
          • 77

          #5
          second attempt...

          Code:
          <?php 
          $spy2 = fopen("spy2.html" , "a");
          
             echo "<html><head><title>HerpSpy</title></head>"; 
             echo "<body><h1>User Info:</h1>"; 
             echo "$HTTP_REFERER=".getenv("$HTTP_REFERER")."<br>"; 
             echo "$REMOTE_ADDR=".getenv("$REMOTE_ADDR")."<br>"; 
             echo "$HTTP_USER_AGENT=".getenv("$HTTP_USER_AGENT")."<br>"; 
             echo "$HTTP_ACCEPT=".getenv("$HTTP_ACCEPT")."<br>"; 
             echo "$HTTP_ACCEPT_LANGUAGE=".getenv("$HTTP_ACCEPT_LANGUAGE")."<br>"; 
             echo "$HTTP_ACCEPT_CHARSET=".getenv("$HTTP_ACCEPT_CHARSET")."<br>"; 
             echo "$HTTP_ACCEPT_ENCODING=".getenv("$HTTP_ACCEPT_ENCODING")."<br>"; 
             echo "</body></html>"; 
          fwrite($spy,"<font color='blue'><<<<<------------BEGIN------------>>>>></font><br />");
          fwrite($spy2,"<font color='black'>Site user came from: $HTTP_REFERER <br />");
          fwrite($spy2,"IP Address: $REMOTE_ADDR <br />");
          fwrite($spy2,"Browser: $HTTP_USER_AGENT <br />");
          fwrite($spy2,"$HTTP_ACCEPT: $HTTP_ACCEPT <br />");
          fwrite($spy2,"Language: $HTTP_ACCEPT_LANGUAGE <br />");
          fwrite($spy2,"$HTTP_ACCEPT_CHARSET: $HTTP_ACCEPT_CHARSET <br />");
          fwrite($spy2,"$HTTP_ACCEPT_ENCODING:$HTTP_ACCEPT_ENCODING <br />");
          fwrite($spy2,"<font color='red'><<<<<------------END------------>>>>></font><p/><p>");
          
          fclose($spy2);
          
          
          ?>
          but still getting same ip! why? Other visitors ARE getting logged, as Ive added Language and seen diff languages in the logs but still same ip and not showing the rerrer page !Help

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Is IP Addr: 192.168.0.5, yours? MAybe you should check.

            It might be the server your on?

            But i'm not really sure..

            i've not done much with REMOTE_ADDR but i'll have a play around n hopefuly give you some more input.

            Comment

            • Inny
              New Member
              • Nov 2007
              • 77

              #7
              No its not my ip (see ip resolution above) Im in Australia mate!
              Got me beat though! Hope you can help.
              Cheers

              this is what im getting on that ip

              OrgName: Internet Assigned Numbers Authority
              OrgID: IANA
              Address: 4676 Admiralty Way, Suite 330
              City: Marina del Rey
              StateProv: CA
              PostalCode: 90292-6695
              Country: US

              NetRange: 192.168.0.0 - 192.168.255.255
              CIDR: 192.168.0.0/16
              NetName: IANA-CBLK1
              NetHandle: NET-192-168-0-0-1
              Parent: NET-192-0-0-0-0
              NetType: IANA Special Use
              NameServer: BLACKHOLE-1.IANA.ORG
              NameServer: BLACKHOLE-2.IANA.ORG
              Comment: This block is reserved for special purposes.
              Comment: Please see RFC 1918 for additional information.
              Comment:
              RegDate: 1994-03-15
              Updated: 2002-09-16

              OrgAbuseHandle: IANA-IP-ARIN
              OrgAbuseName: Internet Corporation for Assigned Names and Number
              OrgAbusePhone: +1-310-301-5820
              OrgAbuseEmail: abuse@iana.org

              OrgTechHandle: IANA-IP-ARIN
              OrgTechName: Internet Corporation for Assigned Names and Number
              OrgTechPhone: +1-310-301-5820
              OrgTechEmail: abuse@iana.org

              # ARIN WHOIS database, last updated 2007-11-25 19:10
              # Enter ? for additional hints on searching ARIN's WHOIS database

              Comment

              • Inny
                New Member
                • Nov 2007
                • 77

                #8
                Bump Please help? How can I avoid Getting Index Pages ? Including Referer php in the script tags not working.
                Also Cant get real Ip

                Comment

                Working...