Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-25-2005, 03:13 AM   #1
BSOD
 
Join Date: May 2005
Posts: 10
Default Need some help. (PHP);

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;">
&nbsp;
<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.
0x00 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:25 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0