'w+' - Open for reading and writing; place the file pointer at the beginning
of the file and truncate the file to zero length. If the file does not
exist, attempt to create it.

Change it to "r" since you are only reading. Also check to make sure your
pathing is correct.

---
Brad Dameron                                                                    
Network Account Executive
TSCNet Inc.                                                                            
 www.tscnet.com
Silverdale, WA.                                                                 
1-888-8TSCNET



> -----Original Message-----
> From: phper [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 27, 2002 2:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] file reading
>
>
> how do I read the contents of a file.
>
> $FileStream = fopen("webmaster/forum".$Forum."/forumtopics.txt", "w+");
>   $line = fgetss ($FileStream, 255);
>   print ("number is: ".$line." <br> ");
>
>   fclose($FileStream);
>
>   always returns nothing
>
>
>
> --
> 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

Reply via email to