Regarding file management in php?

File Management Add comments
file management
tsb t asked:

Respected Sir,

I am getting some problem while using fopen command while i try to run the script in the mozilla firefox

i am getting the error like tis

Warning: fopen(welcome.txt) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\trail\file.php on line 5
and my actual code is like this


< ?php
$file=fopen("welcome.txt","r");
?>

and i wanna say another thing also this code s running in internet explorer.

So plz give me the solution for this..

Thanking you

Savitha Bhargav

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace
3 Responses to “Regarding file management in php?”
  1. happygal Says:

    well the problem is you have not created welcome.txt file if you had it would not have given you this error. Make sure the file welcome.txt is in the same folder as the script, else you will need to specify full path. :)

  2. thedeplorableword Says:

    Make sure you’ve created welcome.txt and it’s in the right directory, if that’s ok try this

  3. Adam Says:

    Perhaps you’re looking to write to the file? In PHP you can open a file with fopen using the w or a flag in the second argument. That will create the file for you if it doesn’t exist.

    But if you are looking to read the file, then it just doesn’t exist at the moment. Create it and the error will go away.

    Adam @

Leave a Reply

Cuddly Family Pets | Entries RSS Comments RSS Log in