RE: [PHP] Beginner question?

From: Date: Fri, 21 Dec 2001 05:16:31 +0000
Subject: RE: [PHP] Beginner question?
Groups: php.general 
Request: Send a blank email to php-general+get-78412@lists.php.net to get a copy of this message
<?php //$fp = fopen ("C:/Program Files/localhost/info.txt", "r"); //$fp = fopen ("http://compcanlit.ca/", "r"); $fp = fopen ("./info.txt", "r"); while (!foef($fp)) { $line = fgets($fp, 1024); echo $line; } fclose($fp); ?> what you were doing was opening a file ready for reading and then printing the pointer to the file, and not the file itself... -----Original Message----- From: jtjohnston [mailto:jtjohnston@courrier.usherb.ca] Sent: Friday, December 21, 2001 4:13 PM To: php-general@lists.php.net Subject: [PHP] Beginner question? This seems newbie. So what am I doing wrong? I want to print the contents of the file. I get resource id #1 instead. Do I need to add a header or what? <?php //$fp = fopen ("C:/Program Files/localhost/info.txt", "r"); //$fp = fopen ("http://compcanlit.ca/", "r"); $fp = fopen ("./info.txt", "r"); print $fp; fclose($fp); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#78412) next »