Assistance with Saving to File
Posted: Thu Aug 15, 2002 3:36 pm
I am using the following PHP code to process fields from a form. I am presently getting the following error.
Warning: fopen("me.txt", "a+") - Permission denied in /home/www/insidebroadway.org/friend_form_handle.php on line 20
I have confirmed with my ISP that the permissions are set up properly (which would make sense since I can ftp html files to this directory). What I'm ULTIMATELY trying to do here is use datestamp() to create a unique file name (as you can probably see from the commented out lines.)
Thanks so much for your help. --Andy
Here's the PHP code:
<?
//PHP Script to save variables into file.
function WriteToFile ($firstName, $friendsEmail, $message){
//Creating a Date String to create unique file names.
$TheDate = time();
$DateString = $TheDate . ".txt";
$TheFile = "test.txt";
$Open = fopen("me.txt", "a");
if ($Open) {
fwrite ($Open, "$firstName+\r$message");
fclose($Open);
$Worked = TRUE;
} else {
$Worked = FALSE;
}
return $Worked;
}
//Call the function.
WriteToFile($firstName, $fiendsEmail, $message);
?>
Warning: fopen("me.txt", "a+") - Permission denied in /home/www/insidebroadway.org/friend_form_handle.php on line 20
I have confirmed with my ISP that the permissions are set up properly (which would make sense since I can ftp html files to this directory). What I'm ULTIMATELY trying to do here is use datestamp() to create a unique file name (as you can probably see from the commented out lines.)
Thanks so much for your help. --Andy
Here's the PHP code:
<?
//PHP Script to save variables into file.
function WriteToFile ($firstName, $friendsEmail, $message){
//Creating a Date String to create unique file names.
$TheDate = time();
$DateString = $TheDate . ".txt";
$TheFile = "test.txt";
$Open = fopen("me.txt", "a");
if ($Open) {
fwrite ($Open, "$firstName+\r$message");
fclose($Open);
$Worked = TRUE;
} else {
$Worked = FALSE;
}
return $Worked;
}
//Call the function.
WriteToFile($firstName, $fiendsEmail, $message);
?>