[SOLVED] ok, heres my new issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

ok, heres my new issue

Post 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
PanK
Forum Commoner
Posts: 36
Joined: Mon Nov 22, 2004 1:24 pm
Location: Richmond Hill, ON, Canada

Post by PanK »

$handle = fopen($filename, "r"); - why r?? Are you going to read, write or append?
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

Post by asi0917 »

i've seprated the reading of the file from the writing of the (file which isn't written yet)
PanK
Forum Commoner
Posts: 36
Joined: Mon Nov 22, 2004 1:24 pm
Location: Richmond Hill, ON, Canada

Post by PanK »

what you get rigt now, is what your code is saying. What exactly do you want to get?
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

Post by asi0917 »

this is an older post, i have it working now,
you reloaded that page 7 times in less than 20 seconds :)
PanK
Forum Commoner
Posts: 36
Joined: Mon Nov 22, 2004 1:24 pm
Location: Richmond Hill, ON, Canada

Post by PanK »

Write [SOLVED] in the subject, when it's soved :-)
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

Post by asi0917 »

thnx
Post Reply