...

View Full Version : reading text file?



angst
09-19-2005, 08:50 PM
hi,
thought this would be simple,

my code:



$filename = "../ads/ads.txt";
$txtmp = fopen($filename,"a+");

echo "<textarea>$txtmp</textarea>";



at the moment, just trying to pull a text file into a form/textarea to reading,
but that code just gives me:

Resource id #3

what have i don't wrong?

thanks in advance for your time!
-Ken

NancyJ
09-19-2005, 08:55 PM
$txtmp is the file, not the contents of the file ;) subtle difference
What you want is readfile (http://uk.php.net/manual/en/function.readfile.php)

devinemke
09-19-2005, 09:59 PM
also look at file_get_contents (http://www.php.net/file_get_contents)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum