\n", $new_comment); /* change escaped quotes into non-escaped */ $new_comment = str_replace("\'", "'", $new_comment); $new_comment = str_replace('\"', '"', $new_comment); /* open the comment file */ $fp = fopen ($comment_file, "a") or die ("Couldn't open the file to add comment for ".$slide_url."\n"); /* lock it to protect against concurrent accesses */ flock($fp, LOCK_EX); /* Add the comment and format it */ fwrite($fp, "New comment:
\n"); fwrite($fp, "".$new_comment.""); fwrite($fp, "
\n"); /* unlock and close the file */ flock($fp, LOCK_UN); fclose ($fp); /* go back to the slide */ header("Location: ".$slide_url); ?>