fwrite

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dsdsdsdsd
Forum Commoner
Posts: 60
Joined: Fri Dec 05, 2003 3:10 pm

fwrite

Post by dsdsdsdsd »

hello; I wish to create (or write to) a .htm file; does fwrite care what the extesion is?

Code: Select all

$filename = "pointer.htm";
$file_pointer = fopen($filename , "w");
fwrite($file_pointer , $DHTML_document_string);
fclose($file_pointer);
the directory itself has 777 file permissions as well as pointer.htm (in the case where I attempt to write to it as opposed to create it);

but yet I get a "failed to open stream: Permission denied" error;

any thoughts?
thanks
Shannon Burnett
Asheville NC USA
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Is the PHP running in safe_mode, maybe the file isn't yours? Or maybe this file was locked and wasn't unlocked?
dsdsdsdsd
Forum Commoner
Posts: 60
Joined: Fri Dec 05, 2003 3:10 pm

Post by dsdsdsdsd »

hello;

I have solved my problem, at least partly;

I have discovered that when I set the user permissions on the pointer.htm file via WS_FTP that the 777 permission that I set did not actually stick; indeed when I refreshed the WS_FTP server-side directories the default 644 would magically re-apear;

Shannon
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Probably ftp deamon configuration doesn't let you change file permissions, contact the administrator.
Post Reply