PHP Guestbook _php Tutorials that do not require database support

Source: Internet
Author: User
The code is as follows:
/*

Annotate.php3

This is a module so can be placed on any PHP3 page to allow users to add
Their comments. The comments is stored in a file with the current directory,
Whose name is constructed by adding ". Comment" to the calling pages name,
and merged into the calling page dynamically. (The calling page is not
Modified.)

I wrote this because I wanted a simple-to add this functionality to my
Pages without requiring that MySQL is available.

In the message input, blank lines is converted to paragraph tags. No Other
Conversions is applied. If you dont want your the users to being able to input
HTML, uncomment the "Strip_tags" line.

Note that the directory must is writable by the Web server.

Put This module in some convenient location and then embed it in your pages
Like so:

Require ("/some/full/path/annotate.php3");

Or, relative to the Docroot:
Require ($DOCUMENT _root. "/relativepath/php3");

Steve Yelvington

*/
if ($message)
{
/* Uncomment the next lines to strip out HTML from input */
/* $name = Strip_tags ($name); */
/* $message = Strip_tags ($message); */
$message = ereg_replace ("Rnrn", "N
", $message);
$date = Date ("L, F J Y, h:i a");
$message = " $name--$date
$message
";
$fp = fopen (basename ($PHP _self). ". Comment", "a");
Fwrite ($fp, $message);
Fclose ($FP);
}
@readfile (basename ($PHP _self. ". Comment")));
?>

http://www.bkjia.com/PHPjc/532227.html www.bkjia.com true http://www.bkjia.com/PHPjc/532227.html techarticle The code is as follows:/* ANNOTATE.PHP3 This is a module, can placed on any PHP3 page to allow users to add their comments. The comments is stored in a file in the current directo ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.