Forum Moderators: coopster
<?
// writes to file
$path = "../surveys/xml/$fn";
if (!$handle = fopen($path,"w")) {
echo "Cannot open file ($fn)";
exit;
}
if (fwrite($handle, $p) === FALSE) {
echo "Cannot write to file ($fn)";
exit;
}
echo $p;
fclose($handle);
?>
What I really want is to create a file with out changing the directory permissions (chmod). Can we authenticate as a user and then create it using php.
I am trying yo do it in a hosted apache server in linux.
All fopen kind of things work fine with my localhost.