I made a really simple guestbook.
It stores the 20 most recent submissions.
But the only problem is that it does not except quotes " or these things '
it just puts a big \ in front of them.
How can I change it so it will?
//load poast name for file
@$new_text = $_POST['body'];
@$new_name = $_POST['name'];
$feeder = "<font color=\"#000000\">Poasted by-<b>$new_name</b>:</font>$new_text";
$words = array("shit", "fuck", "Fuck", "Shit", "bitch", "Bitch", "ass", "Ass", "FUCK", "SHIT" , "BITCH", "ASS");
$reply = str_replace($words, "****", "$feeder");
//convert to actual file name with extension
$replylength = strlen($reply);
if ($replylength > 225) {
echo "Post is too long ($replylength Characters) Character limit is 225 \n <a href=\"http://davidw.da.funpic.org/guestbook.php\">Return Home</a> \n message:$reply";
} else {
$filename = "guest.txt";
//open the file
$fp = fopen( $filename,"r");
//read the file and save to old variable
$Old = fread($fp, 3000);
//close the fp variable
fclose( $fp );
//split the old variable into string with [] for extension
$Old = split ("&", $Old);
//add one to the old variable and save it to the new count variable
$feed ="&$reply&$Old[1]&$Old[2]&$Old[3]&$Old[4]&$Old[5]&$Old[6]&$Old[7]&$Old[8]&$Old[9]&$Old[10]&$Old[11]&$Old[12]&$Old[13]&$Old[14]&$Old[15]&$Old[16]&$Old[17]&$Old[18]&$Old[19]";
$fp = fopen( $filename,"w+");
//not so sure
if (flock($fp, 2)) {
//write the fp file as the new variable
fwrite($fp, $feed); }
//close the file
fclose( $fp );
header("Location: [url]http://davidw.da.funpic.org/guestbook.php[/url]");
}