Need some help. (PHP);

<b>test..</b>

Solid State Member
Messages
11
I am writing a news script but I can't seem to figure out how to have the most recent on top.

Here is the code:

Code:
<table class="shoutbox_formarea" width="100%">
<tr><td bgcolor="#436741"><div align="center">
<form action="<? $_POST["$both"]; ?>" method="post">
<input name="name" type="text" class="shoutbox_input" value="Name" size="22" style="background-color: #709565; border: 1px solid #274422; font-family: Tahoma; font-size: 11px;">
<br>
<textarea NAME="content" style="background-color: #709565; border: 1px solid #274422; font-family: Tahoma; font-size: 11px;" rows="10" cols="30"></textarea>
<br>
<INPUT TYPE="submit" NAME="submit" value="Send" style="background-color: #709565; border: 1px solid #274422; font-family: Tahoma; font-size: 11px;">
 
<input type="reset" name="reset" value="Reset" style="background-color: #709565; border: 1px solid #274422; font-family: Tahoma; font-size: 11px;">
</form></table></tr></td></div>
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
$content = $_POST['content'];
$both = $name & $content;
$date = date("l dS of F Y h:i:s A");
$message = strip_tags($content, '<a><b><i><u>');
if(empty($name) || empty($content)){
			if(empty($name)){
				echo "<font color=red face=tahoma size=1>Please Enter A Name<br></font>";
			}
				if(empty($content)){
					echo "<font color=red face=tahoma size=1>Please Enter A Message<br></font>";
					
				}
		}
			else{
				$mes_file = "../../css/news.txt";
				$open_file = fopen($mes_file,"a+");
$string ='<table cellpadding="2" cellspacing="1" width="100%">
<tr><td style="border: 1px solid #274422; border-top: 0px; border-bottom: 0px;" width="100%" bgcolor="#274422">
<font size="2" face="Trebuchet MS" color="#FFFFFF"><b>' . $name . ' - ' . $date . '</b></font></tr></td>
<td style="border: 1px solid #274422; border-top: 0px; border-bottom: 0px;" width="100%" bgcolor="#274422">
<font class="font22">' . $content . '</font></tr></td></table><br>';
					
					if(!fwrite($open_file,$string)){
					echo "<font color=red face=tahoma size=1>Could Not Write To: " . $mes_file . "</font>";
				}
					else{
			echo '';
		}
	}
}

?>

If you can edit it somehow to have the most recent on top, or know another way, it would be very helpful.

Thanks.
 
Back
Top Bottom