but ...

// WORKS FOR ME
$hostname = gethostbyaddr($REMOTE_ADDR);

// DOES NOT WORK FOR ME ==> EMPTY
$ip = $REMOTE_ADDR;

// DOES NOT WORK FOR ME
$port = $REMOTE_PORT;

// BUT

// WORKS FOR ME
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

// WORKS FOR ME
$ip = $_SERVER['REMOTE_ADDR'];

// DOES NOT WORK FOR ME
$port = $_SERVER['REMOTE_PORT'];


i'm not sure why!? mybe it's the server!?

    yes, it was the server!

    on WIN2k server i just have

    $SERVER['REMOTE_ADDR']
    $
    SERVER['REMOTE_HOST']

    BUT on FreeBSD

    $SERVER['REMOTE_ADDR']
    $
    SERVER['REMOTE_PORT']
    $_SERVER['REMOTE_USER']

    ceeyaa.MeX

      darn

      i dont get a file output of anykind

        Originally posted by numblock
        darn

        i dont get a file output of anykind

        if you don't get any error message you have a remote.txt file on your webserver in the same directory of the php-script

        if you call the php script like
        www.yourdomain.com/displayip.php
        you can show the the remote.txt like
        www.yourdomain.com/remote.txt

        ceeyaa.MeX

          that means that you are not allowed to save the file in that directory!

          you have to change the rights for the dir 'testsite2'!!

          with your ftp client go to properties of the dir and change JUST the WRITE property for 'OTHERS' or 'WORLD' to 'YES'!!

          then it should work!!

          if you have a db you can alsi log the data to that!

          ceeyaa.MeX

            alright the script seems to work now .

            no errors

            thanks

            now how do i get this script to interact with a html webpage so that the info will be pulled from the visitors and saved into that file remote.txt ?

              yep its working now Thank you

              $fp = fopen('remote.txt', 'a+');

              and to store the remote.txt file into a directory within the dir that contains the html file i do what ?

              '/newdir/remote.txt'

              something like that ??

                ok it works on internet explorer

                fine and dandy 🙂

                on netscape i get this displayed when i access that page

                HOSTNAME ==> $hostname"; //echo "

                IP ==> $ip

                "; //echo "

                PORT ==> $port

                "; $time = date("Y-m-d H:i:s"); $string = $time . ' ==> ' . 'HOSTNAME: ' . $hostname . '; IP: ' . $ip . '; PORT: ' . $port . "\r\n"; $fp = fopen('remote.txt', 'a+'); $fw = fwrite($fp, $string); $fc = fclose($fp); ?>

                the code just displayed on the screen ...

                any ide how to fix this ?

                  hmmm ... that's funny ... no idea why!?

                  check your script if it is 'well formed'!

                  <?php
                  
                  // PHP CODE
                  
                  ?>
                  <HTML>
                  <HEAD></HEAD>
                  <BODY>
                    <p>some text</p>
                  </BODY>
                  </HTML>
                  

                  maybe netscape needs a perfect site!? 😉

                  ceeyaa.MeX

                    Originally posted by numblock
                    ok it works on internet explorer

                    fine and dandy 🙂

                    on netscape i get this displayed when i access that page

                    HOSTNAME ==> $hostname"; //echo "

                    IP ==> $ip

                    "; //echo "

                    PORT ==> $port

                    "; $time = date("Y-m-d H:i:s"); $string = $time . ' ==> ' . 'HOSTNAME: ' . $hostname . '; IP: ' . $ip . '; PORT: ' . $port . "\r\n"; $fp = fopen('remote.txt', 'a+'); $fw = fwrite($fp, $string); $fc = fclose($fp); ?>


                    the code just displayed on the screen ...

                    any ide how to fix this ?

                    i've just had a look with:
                    (01) Netscape 6.2.3 ==> WORKED
                    (02) Netscape Communicator 4.78 ==> WORKED
                    (03) Mozilla 1.0 ==> WORKED
                    (04) Opera 6.03 ==> WORKED

                    did you change anything to get it work now!?

                    ceeyaa.MeX

                      Write a Reply...