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
asi0917
Forum Commoner
Posts: 41 Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:
Post
by asi0917 » Thu Nov 25, 2004 1:06 pm
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ї'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 » Thu Nov 25, 2004 1:48 pm
$handle = fopen($filename, "r"); - why r?? Are you going to read, write or append?
asi0917
Forum Commoner
Posts: 41 Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:
Post
by asi0917 » Thu Nov 25, 2004 1:51 pm
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 » Thu Nov 25, 2004 1:54 pm
what you get rigt now, is what your code is saying. What exactly do you want to get?
asi0917
Forum Commoner
Posts: 41 Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:
Post
by asi0917 » Thu Nov 25, 2004 1:57 pm
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 » Thu Nov 25, 2004 2:02 pm
Write [SOLVED] in the subject, when it's soved
asi0917
Forum Commoner
Posts: 41 Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:
Post
by asi0917 » Thu Nov 25, 2004 2:13 pm
thnx