Ok, so I am using Plesk 7.0.2, (vhost on a friend's server), Trying to create a SIMPLE file... now I use the following script, directly off of php.net and it gives the error:
The file test.txt is not writable
I am like WTF mate? anyways... so would it be anything I could possibly do... or any suggestions on what to look at? (I've tried including the whole location of the file..etc..) Any help would be appreciated. Thanks.
$filename = 'test.txt';
$somecontent = "Add this to the file\n";
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}