View Full Version : reading text file?

09-19-2005, 07:50 PM
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!

09-19-2005, 07: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)

09-19-2005, 08: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