Try:
<?php $file = @file('text.txt'); if (!$file) { echo "Ouch ... I couldn't open the file..."; } for ($i = 0, $count = count($file); $i < $count; $i++) { echo $file[$i]; } ?> Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -----Original Message----- From: jennifer [mailto:[EMAIL PROTECTED]] Sent: Friday, 11 October 2002 12:14 AM To: [EMAIL PROTECTED] Subject: [PHP] connecting to a txt file - newbie good morning, im having some issues with the simple task of pulling from a txt file. my code is: <html> <head> <title>job app</title> </head>db <body> <?php if(!$file=fopen("text.txt", "r")) { echo("couldnt open the file"); } else { $text = fread($file, 100); fclose($file); } ?> </body> </html> and the txt file contains one line of bogus txt. you can see my results here: http://www.villany2k1.com/text.php. if anyone has any info as to what i am doing wrong, i would really appreciate it. thanks so much jennifer ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php