Ip Adress

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ip Adress

    Hi there coders

    Can any one tell me the code to get user ip address?

    #2
    Code:
    <?php
    $ip = getenv(&#39;REMOTE_ADDR&#39;);
    ?>
    or

    Code:
    <?php
    $ip = $_SERVER[&#39;REMOTE_ADDR&#39;];
    ?>
    i think

    Comment


      #3
      Thanks ....

      It work

      Comment


        #4
        Oh it does work really also wud like to kno code for user browser .........thnx ..

        Comment


          #5
          Oh also pls tell me like if i want to see ip of a particular user how can i do it wid dis code

          Comment


            #6
            USE THIS:


            make the : DATA.txt - change to 777, change wml.php and xhtml.php with your value.
            1. <?php
            2. function add_entry($date,$agent,$accept,$ip,$char,$enc,$lan g,$con,$ref,$rem,$port,$url,$fname,$sname ){
            3. $myFile = "DATA.txt";
            4. $fh = fopen($myFile, &#39;a&#39;) or die("can&#39;t open file");
            5. $stringData = "$date - | $agent | $accept | $ip | $char | $enc | $lang | $con | $ref | $rem | $port | $port | $url | $fname | $sname |\n" ;
            6. fwrite($fh, $stringData);
            7. fclose($fh);
            8. }
            9. $date = date("| Y-m-d | - | H:i:s |");
            10. $useragent = $_SERVER[&#39;HTTP_USER_AGENT&#39;];
            11. $accept = $_SERVER[&#39;HTTP_ACCEPT&#39;];
            12. $ip = $_SERVER[&#39;SERVER_ADDR&#39;];
            13. $char = (isset($_SERVER[&#39;HTTP_ACCEPT_CHARSET&#39;]) ? $_SERVER[&#39;HTTP_ACCEPT_CHARSET&#39;] : null);
            14. $enc = (isset($_SERVER[&#39;HTTP_ACCEPT_ENCODING&#39;]) ? $_SERVER[&#39;HTTP_ACCEPT_ENCODING&#39;] : null);
            15. $lang = (isset($_SERVER[&#39;HTTP_ACCEPT_LANGUAGE&#39;]) ? $_SERVER[&#39;HTTP_ACCEPT_LANGUAGE&#39;] : null);
            16. $con = (isset($_SERVER[&#39;HTTP_CONNECTION&#39;]) ? $_SERVER[&#39;HTTP_CONNECTION&#39;] : null);
            17. $ref = (isset($_SERVER[&#39;HTTP_REFERER&#39;]) ? $_SERVER[&#39;HTTP_REFERER&#39;] : null);
            18. $rem = $_SERVER[&#39;REMOTE_ADDR&#39;];
            19. $port = $_SERVER[&#39;REMOTE_PORT&#39;];
            20. $url = $_SERVER[&#39;REQUEST_URI&#39;];
            21. $fname = $_SERVER[&#39;SCRIPT_FILENAME&#39;];
            22. $sname = $_SERVER[&#39;SCRIPT_NAME&#39;];
            23. add_entry($date,$useragent,$accept,$ip,$char,$enc, $lang,$con,$ref,$rem,$port,$url,$fname,$sname);
            24. $htmlredirect = "xhtml.php";
            25. $wmlredirect = "wml.php";
            26. if(strpos(strtoupper($_SERVER[&#39;HTTP_ACCEPT&#39;]),"VND.WAP.WML") > 0){
            27. header("Location: ".$wmlredirect);
            28. exit;
            29. }
            30. else
            31. {
            32. header("Location: ".$htmlredirect);
            33. exit;}
            34. ?>
            edit and capture all about phone, user, etc.
            http://ngeo.ro

            Comment


              #7
              Thnx Man tht works superb nd gives tht much details tht i dont understand many of them Lolz thnx ....

              Comment


                #8
                u need a complete user.php for your chat site.. which cn shows ip and browser details?

                Comment


                  #9
                  oh regulus this is for you... total user.php.. when you have free time from chatzone.. upload that to your new chat site.. ok?
                  Attached Files

                  Comment


                    #10
                    I already have this one but thnx

                    Comment


                      #11
                      how bout showing phone number and access point of a user?? i saw a site that display those things.

                      Comment


                        #12
                        What my SITE PMPL i got that lol
                        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                        Visit: WapMasterz Coming Back Soon!
                        _______
                        SCRIPTS FOR SALE BY SUBZERO
                        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                        _______
                        Info & Tips
                        php.net
                        w3schools.com

                        Comment


                          #13
                          oh its my pleasure... its working for old chat scripts...

                          Comment

                          Working...
                          X