fopen() can't open file?
Posted: Sun Jan 25, 2004 8:17 pm
can anyone tell me why this might not be able to open a file that is chmoded 777?
also, could anyone tell me what the @ symbol does in front of a function? It was in my PHP fast and easy web development book, so i just wrote it the same way... hoping it would work, i've tried everything that i can think of.
Code: Select all
$filename = "/home/webkin/public_html/news.php";
$username = $_POSTїusername];
$usernews = $_POSTїusernews];
if ($username == "") {
header( "Location: newssubmit.php");
}
if ($usernews == "") {
header( "Location: newssubmit.php");
}
$addtofile = "";
$addtofile .= "$username says:<br>/n
$usernews <br>";
$addtofile .= "-- date(Mjy)";
$filepointer = @fopen($filename, "W+") or die("couldnt open file");
@fwrite($filepointer, $addtofile) or die("Couldn't add news to $filename");
$msg = "<p>News was successfully added to $filename.</p>";
fclose($filename);