help.... Below are the codes to create "names.txt" in my server. but why there's still error when i execute it in server? (it runs well in localhost)
php file
----------
$fp = fopen( "names.txt", "w" );
chmod("names.txt", 0777);
if(!$fp)
{
echo "Couldn't open the data file. Try again later.";
exit;
}
$fp = fopen( "names.txt" , "w" );
fwrite( $fp, $message );
fclose( $fp );
error
------
Warning: fopen(names.txt): failed to open stream: Permission denied in /home/sonyaibo/public_html/sendmail.php on line 9
Couldn't open the data file. Try again later.
php file
----------
$fp = fopen( "names.txt", "w" );
chmod("names.txt", 0777);
if(!$fp)
{
echo "Couldn't open the data file. Try again later.";
exit;
}
$fp = fopen( "names.txt" , "w" );
fwrite( $fp, $message );
fclose( $fp );
error
------
Warning: fopen(names.txt): failed to open stream: Permission denied in /home/sonyaibo/public_html/sendmail.php on line 9
Couldn't open the data file. Try again later.