PDA

View Full Version : php's fopen()


dsdsdsdsd
12-13-2003, 10:40 PM
hello;
I have a .txt that I am trying to write to; it is set now at 777 and the directory that it is in is also set to 777; when using

<?php
if (is_writeable("H_B_scroller_1_captions.txt"))
{ echo "&pass_word_OK=yes"; //echos to a .swf file
$opened_file = fopen("H_B_scroller_1_captions.txt","wb");
fwrite($opened_file,"blah=hhjhh&");
fclose($opened_file);
}
else
{echo "&pass_word_OK=no"; //echos to a .swf file
}
?>

I get a "no" response;


Next I deleted the "H_B_scroller_1_captions.txt" thinking that the fopen() could create the .txt

<?php
$opened_file = fopen("H_B_scroller_1_captions.txt","wb");
fwrite($opened_file,"blah=hhjhh&");
fclose($opened_file);
?>

however the .txt file is not getting created;

I also posted this post on the AScript page so some may get aggravated at me for 'double posting' - to those angry people: "easy";

any thoughts?
thanks
Shannon Burnett
Asheville NC USA

retrotron
12-26-2003, 07:24 PM
Have you tried opening it with the 'w+' mode rather than 'wb'?

_$opened_file_=_fopen("H_B_scroller_1_captions.txt","w+");_