How to make php guestbook

A very simple guestbook example to illustrate basic file handling. Today I prepared new and interesting tutorial – I will tell how you can create an Ajax PHP guestbook with your own unique design. Our records will be saved into an SQL database. This table will contain: name of sender, email, guestbook record, date-time of record and ip of sender. Of course, we will use jQuery too (to make it ajax-y). One of the important features will be spam protection (we can post no more than one record every 10 minutes)! 

PHP-guestbook

PHP guestbook code :

Here we are discussing about guestbook php demo, php guestbook tutorial php guestbook without database php guestbook script.

<html><head><title>My Guestbook</title></head>
<body>
<h1>Welcome to my Guestbook</h1>
<h2>Please write me a little note below</h2>
<form action=”<?=”$PHP_SELF#results”?>” method=”POST”>
<textarea cols=40 rows=5 name=note wrap=virtual></textarea>
<input type=submit value=” Send it “>
</form>
<?if(isset($note)) {
$fp = fopen(“/tmp/notes.txt”,”a”);
fputs($fp,nl2br($note).'<br>’);
fclose($fp);
}
?><h2>The entries so far:</h2>
<? @ReadFile(“/tmp/notes.txt”) ?>
</body></html>

 

Add a Comment

Your email address will not be published. Required fields are marked *