Page 1 of 1

is_writeable()

Posted: Sat Dec 13, 2003 6:06 pm
by dsdsdsdsd
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

Code: Select all

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

Code: Select all

<?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;

any thoughts?
thanks
Shannon Burnett
Asheville NC USA

Posted: Sat Dec 13, 2003 6:38 pm
by niceguyeddie
Since you are not suppressing errors, the first question would be are you getting any? If not, then I would suspect that the path is something other than you think. Try specifying the path:

$opened_file = fopen("/home/foo/bar/H_B_scroller_1_captions.txt","wb");

http://www.php.net/manual/en/function.fopen.php

Posted: Sat Dec 13, 2003 8:31 pm
by dsdsdsdsd
hello niceguyeddie; thanks for your response;

I am not getting any errors; I made several alterations to my text file's path but yet no change in effectiveness; I have read through the php link also but it does not shed any new light (or if it does I can not see it);
I have also called my server company but they say that I should wait til Monday to talk to their php person; oh well;

Shannon