Simple php help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bear
    Confirmed User
    • Jul 2001
    • 261

    #1

    Simple php help

    Hello,

    I need real urgent help to write a simple php script to print my current ip address.

    Can anybody give me some tips? Thanks a lot.
  • Rorschach
    So Fucking Banned
    • Aug 2002
    • 5579

    #2
    PHP Code:
    <?
    
    print ('Your IP is: '.$REMOTE_ADDR.'.');
    
    ?>

    Comment

    • cezam
      Confirmed User
      • Jun 2003
      • 1363

      #3
      hey, i can code it shorter:

      &lt;?=$REMOTE_ADDR?&gt;

      hehe

      Comment

      • Bear
        Confirmed User
        • Jul 2001
        • 261

        #4
        Thanks. it works.

        But the ip shows is something different from http://checkip.dyndns.org/

        Don't you know why?

        Comment

        • SicChild
          Confirmed User
          • Mar 2003
          • 365

          #5
          Are you sure you're not on a proxy or something?

          Comment

          • Rorschach
            So Fucking Banned
            • Aug 2002
            • 5579

            #6
            Originally posted by cezam
            hey, i can code it shorter:

            &lt;?=$REMOTE_ADDR?&gt;

            hehe
            Smartass.

            Comment

            • Bear
              Confirmed User
              • Jul 2001
              • 261

              #7
              Yes, I am sure my broswer is not connect to any proxy. But I am behind a zone alarm firewall and linksys router.

              Comment

              • cezam
                Confirmed User
                • Jun 2003
                • 1363

                #8
                Originally posted by Bear
                Yes, I am sure my broswer is not connect to any proxy. But I am behind a zone alarm firewall and linksys router.
                Post output from our elite script and dyndns's lame script so we can check it out.

                Comment

                • SandraB
                  Confirmed User
                  • Dec 2002
                  • 147

                  #9
                  IP and Hostname.

                  PHP Code:
                  <?php
                  $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
                  // print $hostname;
                  echo "Your current IP Address: $REMOTE_ADDR<br>";
                  echo "Your Hostname: $hostname<br>";
                  ?>
                  If you are using a proxy this will help further..




                  PHP Code:
                  <?php
                  if ($HTTP_X_FORWARDED_FOR)
                  {
                  echo "Warring: You might be using a proxy server to connect us<br><br>";
                  echo "Connected Via: " . $HTTP_VIA . " - " . $REMOTE_ADDR;
                  echo "<br>Your real IP: " . $HTTP_X_FORWARDED_FOR; 
                  }
                  else
                  {
                  echo "You are probably not using a proxy server<br>";
                  echo "Your current IP address: " . $REMOTE_ADDR;
                  echo "<BR>Your Hostname: $hostname<br>";
                  }
                  
                  ?>
                  Good luck

                  Click here to buy Great content in all niches!

                  Comment

                  • Centurion
                    Confirmed User
                    • Dec 2002
                    • 6033

                    #10
                    SPEAKING of php help..

                    If I was to put up or send someone a simple login script that is in php format, could someone show me how & where I could insert a couple of pics in the script? Script ain't that big..but everything I've done to add a pic has resulted in massive failure! grin

                    Hit me up on ICQ #6080966

                    Comment

                    Working...