Jump to content

getting error when using fopen


Jeyalakshmi

Recommended Posts

<?php$f=fopen('/home/ramkumar/Desktop/a.txt','r') or exit("unable to open the file");while (!feof($f)) { $x=fgetc($f); echo $x;}fclose($f);?>this is the program i am getting unable to open the file as an output . i tried using both absolute and relative path

Link to comment
Share on other sites

Make sure you have the right path. Print out the variable __FILE__ to see the current path and filename. Sometimes hosts don't let you see the actual path when they set up a virtual directory, but you can't use the virtual directory path to open a file.

Link to comment
Share on other sites

Make sure you have the right path.  Print out the variable __FILE__ to see the current path and filename.  Sometimes hosts don't let you see the actual path when they set up a virtual directory, but you can't use the virtual directory path to open a file.

friends i got the output. problem while saving the file
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...