Reply
PHP writing data files
Old 04-16-2006, 11:22 PM PHP writing data files
daddy2five's Avatar
Skilled Talker

Posts: 77
Name: Daniel
Location: Stony Point , Noth Carolina
OK ,
Here is another error. Can someone please explain to me what exsactly this means.
I'm learing to write data to files.
Here is my code.
PHP Code:
<?php
$newfile 
fopen("C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mydata.txt""a+");
fwrite($newfile"This is a new file.");
fclose($newfile);
echo 
"All done!";
?>
Here is the output to my browser:
Warning: fopen(C:\Program Files\Apache Group\Apache2\htdocs) [function.fopen]: failed to open stream: Permission denied in C:\Program Files\Apache Group\Apache2\htdocs\write_data.php on line 2
Warning: fwrite(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\write_data.php on line 3
Warning: fclose(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\write_data.php on line 4
All done!
__________________
What is Yuwie?
Click here to find out

Last edited by daddy2five : 04-16-2006 at 11:26 PM.
daddy2five is offline
Reply With Quote
View Public Profile Visit daddy2five's homepage!
 
When You Register, These Ads Go Away!
Old 04-17-2006, 12:29 AM Re: PHP writing data files
daddy2five's Avatar
Skilled Talker

Posts: 77
Name: Daniel
Location: Stony Point , Noth Carolina
ok let me reply to my own post. I figured it out.
I needed to create the file "mydata.txt" in my server directory first. It worked. I thought that "a+" would create the file if it didnt exsist, GUESS NOT! lol.
__________________
What is Yuwie?
Click here to find out
daddy2five is offline
Reply With Quote
View Public Profile Visit daddy2five's homepage!
 
Old 04-17-2006, 02:13 AM Re: PHP writing data files
sacx13's Avatar
Experienced Talker

Posts: 32
Location: Here
Because your web server dose't have enough permissions out of his web dir. Try to create this file in you web folder.

Regards
Adrian
sacx13 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP writing data files
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11468 seconds with 12 queries