hospitalshouts.php
<?
if(isset($_POST['Submit']))
{
?><table width="100%" border="0" cellspacing="1" bordercolor="#000000" bgcolor="#cDCDCD">
<tr><br/><td width=50% align=center>Posted.</td></tr>
<tr>
<td width="432"><?
$dataf = "hospitalshouts.txt";
$name = $ir['username'];
$message = $_POST['message'];
$fo=fopen("$dataf","r");
$stuff=file_get_contents("$dataf");
fclose($fo);
$message = preg_replace("/[^a-zA-Z]/", "", $message);
$comfile = file($dataf);
if ($message != "")
{
$file = fopen("hospitalshouts.txt","w");
$stuff2 = "<table width='100%' border='0' align='center' cellspacing='0' id='shouttext' style='border: 1px solid #999999;'>
<tr><td bgcolor=#DCDCDC> </td></tr>
<tr><td bgcolor=#DCDCDC><font color=black><i>$name</i>: $message</font></td></tr>
<tr><td bgcolor=#DCDCDC> </td></tr>
</table>";
$stuff3=$stuff2.$stuff;
$write = fwrite($file,"$stuff3");
fclose($file);
}
?></td>
</tr>
</table><? } ?>
<hr width=60%/>
<br/>
<table width=50% id="shoutboxouter">
<tr>
<td bgcolor=#999999 align=center>
Shouts
</td>
</tr>
<tr>
<td>
<? include("hospitalshouts.txt"); ?>
</td>
</tr>
</table>
<table width="50%" id="shoutboxouter" style="border: 1px solid #999999;">
<tr>
<td width="75%" align=center><form name="guestbook" action="" method="post">
<p>
<input name="message" type="text" id="message" size="50"><input type="submit" name="Submit" value="Shout">
</p>
</form></td>
</tr>
</table>
jailshouts.php
<?
if(isset($_POST['Submit']))
{
?><table width="100%" border="0" cellspacing="1" bordercolor="#000000" bgcolor="#cDCDCD">
<tr><br/><td width=50% align=center>Posted.</td></tr>
<tr>
<td width="432"><?
$dataf = "jailshouts.txt";
$name = $ir['username'];
$message = $_POST['message'];
$fo=fopen("$dataf","r");
$stuff=file_get_contents("$dataf");
fclose($fo);
$message = preg_replace("/[^a-zA-Z]/", "", $message);
$comfile = file($dataf);
if ($message != "")
{
$file = fopen("jailshouts.txt","w");
$stuff2 = "<table width='100%' border='0' align='center' cellspacing='0' id='shouttext' style='border: 1px solid #999999;'>
<tr><td bgcolor=#DCDCDC> </td></tr>
<tr><td bgcolor=#DCDCDC><font color=black><i>$name</i>: $message</font></td></tr>
<tr><td bgcolor=#DCDCDC> </td></tr>
</table>";
$stuff3=$stuff2.$stuff;
$write = fwrite($file,"$stuff3");
fclose($file);
}
?></td>
</tr>
</table><? } ?>
<hr width=60%/>
<br/>
<table width=50% id="shoutboxouter">
<tr>
<td bgcolor=#999999 align=center>
Shouts
</td>
</tr>
<tr>
<td>
<? include("jailshouts.txt"); ?>
</td>
</tr>
</table>
<table width="50%" id="shoutboxouter" style="border: 1px solid #999999;">
<tr>
<td width="75%" align=center><form name="guestbook" action="" method="post">
<p>
<input name="message" type="text" id="message" size="50"><input type="submit" name="Submit" value="Shout">
</p>
</form></td>
</tr>
</table>