Jump to content

Unusual behavior using fopen()


tnesler

Recommended Posts

Hello!

 

I am learning how to interact with text files and I created a PHP file with this line:

 

$myfile = fopen("C:Tomformfile.txt", "w") or die("Unable to open file!");

 

Evidently the "f" character is picked up as a command because I got this error message:

 

Warning: fopen(C:Tomormfile.txt) [function.fopen]: failed to open stream:

Invalid argument in C:xampphtdocsFormFile.php on line 116

Notice that the f has been changed to o

 

Do I need to put in a second in my statement?

 

Thanks for your guidance on this!

 

Tom Nesler

 

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...