Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Chatbox / Guestbook, No Database required
Neutrality
post Feb 20 2005, 03:26 PM
Post #1


Sheathed Motivation
*******

Group: Members
Posts: 126
Joined: 19-February 05
From: Canada
Member No.: 3,868



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!

CODE

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.PHP

if(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.
Go to the top of the page
 
+Quote Post
Dontvoteforbush
post Feb 20 2005, 03:40 PM
Post #2


Newbie
*

Group: Members
Posts: 9
Joined: 20-February 05
Member No.: 3,870



QUOTE(Inspired @ Feb 20 2005, 07:26 AM)
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!

CODE

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.PHP

if(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.
*



Isnt this html code?Do you need copyright permition?
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Feb 20 2005, 03:59 PM
Post #3


Advanced Member
*******

Group: Members
Posts: 144
Joined: 19-February 05
From: Nakorn Chaisri, Thailand
Member No.: 3,864



Absolutely not. That code is in pure PHP - and if the code is written by Inspired, he's opened it up for public use as soon as he posted it in this forum. No copyrights have been mentioned anywhere - so it's free for public domain use...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Mysql Database Setup : Setting Up Mysql Database(6)
  2. Guestbook (cgi-script) Problems(1)
  3. Import From Excel File Into Mysql Database(9)
  4. Mysql Database Size(6)
  5. Connect To Remote Oracle Database With Toad(7)
  6. Can You Add Images Into A Mysql Database?(20)
  7. My Guestbook And Spam(11)
  8. Guestbook Spamming(15)
  9. Truefusion Shoutbox(31)
  10. Make $10 Money Instantly Or Free Domain Of Your Choice!(17)
  11. Script Help Required: Undefined Variable(3)
  12. Gimp Abstract Signature Tutorial(9)
  13. Database With Mysql++(7)
  14. Index In A Mysql Database(3)
  15. Linux Anti-virus Software(6)
  1. Ms-access Database Question(3)
  2. I Need Help Transferring Sql Database?(3)
  3. Secure FTP information and assistance required(1)
  4. Guestbooks(0)
  5. How To Manage The Database For E-books Website In My Sql?(3)
  6. Phpmyadmin(7)
  7. Database Or Pdf(3)
  8. Is The Database System Gone Again? [resolved](12)
  9. Need Help With My Database [resolved](6)
  10. Need Advice On Setting Up Mysql Database.(3)
  11. Ips Installer Database Details [resolved](6)
  12. Mysql Database Not Working(3)
  13. Ms Word Document Sample Required(0)


 



- Lo-Fi Version Time is now: 8th September 2008 - 09:32 AM