|
|
|
|
Shoutboxes have become a popular way to leave messages at a
Home » PHP » Chat Systems
Shoutboxes have become a popular way to leave messages at a site.
Shoutboxes have become a popular way to leave messages at a site.
Sponsors - Spoono Host
If you don't know what a ShoutBox is, you can check one out at Deskmod. They're a neat way to let the visitor interact with your website without the hassle of a guestbook. Making your own shoutbox at first might seem hard, but its simple and easy to make. You can see my code that I worked on and made sure worked by right clicking and saving shoutbox.txt. In fact, the one for this tutorial is only 35 lines total. Make a new file and save it as shoutbox.php and put all of the code on this tutorial in the body. Making a shoutbox can all be done with one file, specifically three steps, and you have to work backwards to have it function. First, you must make the submit action, which uploads the name and comments to the mySQL database. Secondly, you must have the display action which displays the comments. Finally, you need the form where the people can add the comments.
Before anything else though, you must make the mySQL database. I decided to add 4 fields to the database: id, name, message, and time. I called the table 'shoutbox' and the database 'news'. You can copy paste this code inside your mySQL database using a program such as PHPMyAdmin, or (type it in by hand if you feel so :) Here is the mySQL code I used:
|
More Tutorials by this user
|
|
|
|
|
|
|
|
|