PDA

View Full Version : reading text comes out wrong :(


smartie_on_computer
04-25-2006, 06:39 AM
hey every body, i im kina stuck with this,
i have a simple index php file that will open a txt file and get the ip address out like so
<?php
fread("ip.txt",'r');
$address = explode("=", $str);
print "this current given ip address is:".$address[1];
?>
and the txt file
ip=192.1681.2
but the the fil out puts:
this current given ip address is: // /* */
any idea

thanks

Flash Gordon
04-25-2006, 06:47 AM
$address = explode("=", $str); $str is undefined.

smartie_on_computer
04-25-2006, 06:52 AM
sorry, forgot to change to $ip
but it still doesn't work for me

Flash Gordon
04-25-2006, 06:53 AM
<?php
$str = fread("ip.txt",'r');
$address = explode("=", $str);
echo "this current given ip address is:" . $address[1];
?>

smartie_on_computer
04-25-2006, 07:06 AM
no... still returns:

this current given ip address is: // /* */

smartie_on_computer
04-25-2006, 07:10 AM
still cimes out the same even when i put something differnt in the text file
http://smartie.awardspace.com/

smartie_on_computer
04-25-2006, 08:19 AM
found the problem but thanks for the help