note 19080 deleted from ref.filesystem by spic

From: Date: Tue, 17 Sep 2002 08:59:54 +0000
Subject: note 19080 deleted from ref.filesystem by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-36770@lists.php.net to get a copy of this message
i've looked everywhere for guestbooks without advertisements on them and now that i know how to make them myself i'll give some code out to people who are like i was. so, create three files gbook.txt gbooksign.php and gbook.php **gbooksign.php <html> <body> <form action="gbook.php?action=post" method="post"> <input type="text" name="name" value="Name"> <input type="text" name="comments" value="Comments"> <input type="submit" value="Sign"> </form> <BR> <a href="gbook.php?action=view">View G-Book</a> </body> </html> **gbook.php <html> <body> <?php if ($action=="post"){ $file=("gbook.txt"); $fp=fopen("$file", "a+"); $write=("Name:$name \n Comments:$comments \n"); fwrite($fp, "$write"); fclose($fp); echo "<meta http-equiv='refresh' content='0; url=gbooksign.php'>"; } else if ($action=="view"){ echo "<pre><font face=tahoma>"; include ("gbook.txt"); echo "</font></pre>"; } else { echo "<meta http-equiv='refresh' content='0; url=gbooksign.php'>"; } ?> </body> </html> there you have it.... you dont need to do anything to gbook.txt, upload all three and have fun!

« previous php.notes (#36770) next »