Page 1 of 1

ok, heres my new issue

Posted: Thu Nov 25, 2004 1:06 pm
by asi0917
im trying desperately to work this out on my own but it ain't happening

heres the code

Code: Select all

<html>
<body>
<?
 $ip = $_SERVER&#1111;'REMOTE_ADDR'];
 echo $ip; 
?>
<?
 $filename = "test.txt";
 $handle = fopen($filename, "r");
 $contents = fread($handle, filesize($filename));
 fclose($handle);
 echo "$contents";
 ?>
</body>
</html>
im trying to $ip to test.txt, any help?
current output:
http://hosting.mixcat.com/asi0917/ips.php
________________________
help=good

Posted: Thu Nov 25, 2004 1:48 pm
by PanK
$handle = fopen($filename, "r"); - why r?? Are you going to read, write or append?

Posted: Thu Nov 25, 2004 1:51 pm
by asi0917
i've seprated the reading of the file from the writing of the (file which isn't written yet)

Posted: Thu Nov 25, 2004 1:54 pm
by PanK
what you get rigt now, is what your code is saying. What exactly do you want to get?

Posted: Thu Nov 25, 2004 1:57 pm
by asi0917
this is an older post, i have it working now,
you reloaded that page 7 times in less than 20 seconds :)

Posted: Thu Nov 25, 2004 2:02 pm
by PanK
Write [SOLVED] in the subject, when it's soved :-)

Posted: Thu Nov 25, 2004 2:13 pm
by asi0917
thnx