Jump to content

srose

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Posts posted by srose

  1. Hi

    I have this code:

    <?php
       
    	$myFile = "addresses.txt";
    $fh = fopen($myFile, 'a') or die("can't open file");
    fwrite($fh, $Address);
    fclose($fh);
    $num = $num + 1;
      ?>

     

    $Address will store IP addresses. How can I get each new IP to go in it's own line?  Is there a way of having a number go before it aswell like this:

     

    1.  xxx.xxx.xxx.xxx

    2  xxx.xxx.xxx.xxx

  2. Hi

    I am wanting to display users IP address on my site.  I typed this into a paragraph:

     

    <p>
    <?php
    $user_ip = $SERVER['REMOTE_ADDR'];
    print "Your I P Address is " . $user_ip;
    ?>
    </p>
    

    All this does is print "Your I P Address is", but it does not say the IP.

     

    What is wrong here.

     

    Thanks

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.