missing-score
03-02-2003, 10:53 AM
I am making a system for the main page of my site, where admins can add a news item to the page using PHP ( like a message board. )
I have used a simple code for adding links to the page ect ( like the one on here, but when I try and post the message, it posts 2 of them, 2 of the same message.
I have checked about everything I can think of, and It doesn't seem to help. Down to this basic code below, it still posts 2 messages.
Can anyone help and tell my WHY?
<?php
$subj = rmvHTML($subject);
$pmsg = rmvHTML($message); // rmvHTML replaces < and > with < and >
$pmsg = toCode($message); // toCode replaces stuff like [BOLD] with <strong>
$amFile = fopen('newslog.dat','a');
flock($amFile,2);
fwrite($amFile,"\n\n<!-- START NEW POST -->\n<center>
<table width=\"590\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"300\" colspan=\"300\" style=\"border:1px solid #999999; border-right:0px; padding-left:8px\" bgcolor=\"#EEEEEE\"><p id=\"form\"><img src=\"itkb/bullet1.gif\" />$subj</p></td>
<td width=\"290\" colspan=\"290\" style=\"border:1px solid #999999; border-left:0px; padding-left:8px\" bgcolor=\"#EEEEEE\" align=\"right\"><p id=\"small\">Posted By: $user<img src=\"pixel.gif\" width=\"5\" height=\"1\" /></td>
</tr>
<tr>
<td width=\"590\" colspan=\"590\" style=\"border:1px solid #999999; border-top:0px; padding-left:21px; padding-top:4px; padding-bottom:0px; padding-right:4px\" bgcolor=\"#FFFFFF\"><p id=\"small\">$pmsg</p>
<p id=\"small\" align=\"right\"><a class=\"nvs2\" href=\"mailto:$mail\">e-mail this person</a> | <a class=\"nvs2\" href=\"$site\">visit site</a> | <a class=\"nvs2\" href=\"$rel\">similar topics</a>
</td>
</tr>
</table>
</center>
<br /><br />\n\n<!-- END POST -->");
flock($amFile,3);
fclose($amFile);
?>
Thanks!
( If you need to have a look at the layout ( i dont think that would be a problem ) then go to http://www.itoolkit.net/itk
I have used a simple code for adding links to the page ect ( like the one on here, but when I try and post the message, it posts 2 of them, 2 of the same message.
I have checked about everything I can think of, and It doesn't seem to help. Down to this basic code below, it still posts 2 messages.
Can anyone help and tell my WHY?
<?php
$subj = rmvHTML($subject);
$pmsg = rmvHTML($message); // rmvHTML replaces < and > with < and >
$pmsg = toCode($message); // toCode replaces stuff like [BOLD] with <strong>
$amFile = fopen('newslog.dat','a');
flock($amFile,2);
fwrite($amFile,"\n\n<!-- START NEW POST -->\n<center>
<table width=\"590\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"300\" colspan=\"300\" style=\"border:1px solid #999999; border-right:0px; padding-left:8px\" bgcolor=\"#EEEEEE\"><p id=\"form\"><img src=\"itkb/bullet1.gif\" />$subj</p></td>
<td width=\"290\" colspan=\"290\" style=\"border:1px solid #999999; border-left:0px; padding-left:8px\" bgcolor=\"#EEEEEE\" align=\"right\"><p id=\"small\">Posted By: $user<img src=\"pixel.gif\" width=\"5\" height=\"1\" /></td>
</tr>
<tr>
<td width=\"590\" colspan=\"590\" style=\"border:1px solid #999999; border-top:0px; padding-left:21px; padding-top:4px; padding-bottom:0px; padding-right:4px\" bgcolor=\"#FFFFFF\"><p id=\"small\">$pmsg</p>
<p id=\"small\" align=\"right\"><a class=\"nvs2\" href=\"mailto:$mail\">e-mail this person</a> | <a class=\"nvs2\" href=\"$site\">visit site</a> | <a class=\"nvs2\" href=\"$rel\">similar topics</a>
</td>
</tr>
</table>
</center>
<br /><br />\n\n<!-- END POST -->");
flock($amFile,3);
fclose($amFile);
?>
Thanks!
( If you need to have a look at the layout ( i dont think that would be a problem ) then go to http://www.itoolkit.net/itk