bejayel
09-25-2003, 08:20 PM
WEll haha, here we go this is a very simple to use, bu working guestbook for everyone! Of course since it is so simple i cnt realyl say that it will be the best book ever but hey whatever works work right.
first start by making guestbook.php
<?php
// A simple php guestbook that runs with flat files
// (flat files means NO MYSQL!!)
$formData = '<form action="#" method="post"><input type="text" name="userName" value="Name"><input type="text" name="userMail" value="Email or URL"><textarea name="userComments">Comments</textarea><button type="submit" name="submit">Submit</button></form>';
if (($userName != "") || ($userName != " ")) { // The only error checking feature included...
$gbFile = fopen("guestbook.txt", "a");
fputs($gbFile, "<b>Name:</b> $userName <br><b>Email/URL:</b> $userMail <br><b>Comments:</b> $userComments <br><hr>");
}
include ('guestbook.txt');
print $formData;
?>
then you simply make guestbook.txt and viola yoru very own guestbook! of course i do believe guestbook.txt under a unix server has to be chmod 755 i think.
also try editing what is posted in teh text file for a more dynamic look! have fun.
first start by making guestbook.php
<?php
// A simple php guestbook that runs with flat files
// (flat files means NO MYSQL!!)
$formData = '<form action="#" method="post"><input type="text" name="userName" value="Name"><input type="text" name="userMail" value="Email or URL"><textarea name="userComments">Comments</textarea><button type="submit" name="submit">Submit</button></form>';
if (($userName != "") || ($userName != " ")) { // The only error checking feature included...
$gbFile = fopen("guestbook.txt", "a");
fputs($gbFile, "<b>Name:</b> $userName <br><b>Email/URL:</b> $userMail <br><b>Comments:</b> $userComments <br><hr>");
}
include ('guestbook.txt');
print $formData;
?>
then you simply make guestbook.txt and viola yoru very own guestbook! of course i do believe guestbook.txt under a unix server has to be chmod 755 i think.
also try editing what is posted in teh text file for a more dynamic look! have fun.