Jump to content
xisto Community
Sign in to follow this  
Neutrality

Chatbox / Guestbook No Database required

Recommended Posts

Okay, this is a simple script that lets your visitors enter in messages via a chatbox/guestbook. You can use this how you like. Adjust it if need be. It's very
simple, so there is much room for improvement. Enjoy!

echo "<form action='chatbox.php' method='get'>";echo "Name: <input type='text' name='visName' size=15><br>";echo "Message: <input type='text' name='message' size = 15><br>";echo "<input type='submit' value='Post' name='post'><br>";echo "</form>";CHATBOX.PHPif(isset($post)){     if(file_exists('chatbox.txt'))     {          $fileId = fopen('chatbox.txt', 'a');          fputs($fileId, $_POST['visName']);          fputs($fileId, $_POST['message']);          fclose($fileId);     }     else     {          $fileId = fopen('chatbox.txt', 'w');           fputs($fileId, $_POST['visName']);          fputs($fileId, $_POST['message']);          fclose($fileId);     }}$fileId = fopen('chatbox.txt', 'r');while(!feof($fileId)){     $text = fgets($fileId);     echo "<table>";     echo "<tr><td>".$text."</td></tr>";     echo "</table>";}fclose($fileId);

If there are any errors in this code whatsoever, please reply here and point them out so that I can fix them. I have used this code many times, so I'm hoping that
it's flawless.

Share this post


Link to post
Share on other sites

Okay, this is a simple script that lets your visitors enter in messages via a chatbox/guestbook. You can use this how you like. Adjust it if need be. It's very

simple, so there is much room for improvement. Enjoy!

 

echo "<form action='chatbox.php' method='get'>";echo "Name: <input type='text' name='visName' size=15><br>";echo "Message: <input type='text' name='message' size = 15><br>";echo "<input type='submit' value='Post' name='post'><br>";echo "</form>";CHATBOX.PHPif(isset($post)){     if(file_exists('chatbox.txt'))     {          $fileId = fopen('chatbox.txt', 'a');          fputs($fileId, $_POST['visName']);          fputs($fileId, $_POST['message']);          fclose($fileId);     }     else     {          $fileId = fopen('chatbox.txt', 'w');           fputs($fileId, $_POST['visName']);          fputs($fileId, $_POST['message']);          fclose($fileId);     }}$fileId = fopen('chatbox.txt', 'r');while(!feof($fileId)){     $text = fgets($fileId);     echo "<table>";     echo "<tr><td>".$text."</td></tr>";     echo "</table>";}fclose($fileId);

If there are any errors in this code whatsoever, please reply here and point them out so that I can fix them. I have used this code many times, so I'm hoping that

it's flawless.

52279[/snapback]


Isnt this html code?Do you need copyright permition?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.