MySQL query:
CREATE TABLE shoutbox (
id int(11) NOT NULL auto_increment,
name text NOT NULL,
message longtext NOT NULL,
time text NOT NULL,
ip text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
Code (remember to change config variables -> line 36):
<style type="text/css"> <!-- .shouttableborder { border: 1px dashed #A8A8A8; padding: 2px; } .namepostedbg { background-color: #99AEAE; font-family: Arial, Tahoma; font-size: 10px; color: #FFFFFF; font-weight: normal; text-indent: 2pt; border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: #FFFFFF; } .messagestyle { font-family: Arial, Tahoma; font-size: 10px; color: #99AEAE; background-color: #F5F5F5; text-indent: 2pt; } SELECT, option, textarea, input {  font-family: Arial, Tahoma; font-size: 10px; color: #000000; background-color: #fefefe; border: 1px #000000 solid; } --> </style> <table width="175" border="0" cellpadding="0" cellspacing="0" class="shouttableborder">  <tr>   <? //--- BEGIN CONFIGURATION SECTION $host      ="localhost"; $username    ="yourmysqlusername"; $userpass    ="yourmysqlpass"; $userdatabase  ="yourmysqldatabase"; //--- END CONFIGURATION SECTION mysql_pconnect("$host","$username","$userpass"); mysql_select_db("$userdatabase"); if($submit) { $ipget = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 1");   while($r=mysql_fetch_array($ipget)) { $lastip = $r["ip"]; } $name = strip_tags($_POST['name'], ''); $message = strip_tags($_POST['message'], ''); if($name=="name") {$name = "Guest";}   $time=date("M d, y"); $ip =$REMOTE_ADDR; if($ip==$lastip) {}else{ $result=MYSQL_QUERY("INSERT INTO shoutbox (id,name,message,time,ip)"."VALUES ('NULL','$name', '$message','$time','$ip')"); } } $result = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 6");   while($r=mysql_fetch_array($result))   {       $time=$r["time"];   $id=$r["id"];   $message=$r["message"];   $name=$r["name"]; $ip=$r["ip"]; ?>   <td class="namepostedbg"><? echo $time ?> - <? echo $name ?></td>  </tr>  <tr>   <td class="messagestyle"><p><? echo $message ?></p></td>  </tr>  <? } ?>  <td class="namepostedbg">Add Shout</td>  </tr><tr><td class="messagestyle">  <form action="<? echo $php_self ?>" method="post">   <INPUT TYPE='TEXT' value='name' NAME='name' SIZE=15 maxlength='100'>   <input type='TEXT' value='message' name='message' size=15 maxlength='100'></td></tr>   <tr>    <td class="messagestyle"> <input type="submit" name="submit" value="shout">  </form></td></tr> </table>
If you save the code above in a file named shoutbox.php to put it on your page, all you have to do is put the below code where you want it to be:
<? include('shoutbox.php'); ?>