Forum Moderators: coopster
<?php
$error = "http://www.example.com/PHP/error.php"; // location of error page
$filename = "data.txt";
$box = "http://www.example.com/PHP/shout.php"; // URL of shout box
$max = 512; // maximum size (bytes) of data.txt file
if(filesize($filename) > $max) {
unlink($filename);
}
if (empty($name) ¦¦ empty($message)) { header( "Location: $error" );
} else {
print "Your shout has been added to the box, <a href=$box>Click here</a> to go back the the box ";
$a = fopen( $filename, "a") or die ("could not open $filename for writing please check file permissions");
flock($a, LOCK_SH);
fwrite($a, "<font face=verdana size=2><b>$name</b> : $message</font>
<hr noshade size=1>");
flock($a, LOCK_UN);
fclose($a);
}
?>
i get a permission denied error and the contents of the form ae still written to the file, can anyone see the problem?
[edited by: jatar_k at 5:28 pm (utc) on May 2, 2004]
[edit reason] generalized urls [/edit]