I must be confused as to what the question is...because with 300+ posts I would hope this would be more obvious by now...If you have two POST forms submitting to the same PHP script then add a post variable to each form named "submissionForm" and have it be unique between each form:
Form 1 add:
<input type=hidden name=submissionForm value="form1">
Form 2 add:
<input type=hidden name=submissionForm value="form2">
Change code to:
<?php
if (!empty($_POST)) {
if($submissionFrom == "form1")
{
$query="INSERT INTO ".TBL_AWARDS." VALUES (NULL, '$type','$user', now(), '$acomment')";
// processing logic
if(!$acomment || strlen($acomment = trim($acomment)) == 0)
echo "Comment not entered";
else if(!$acomment || strlen($acomment = trim($acomment)) < 10)
echo "Comment too short, must be 10 characters at least";
else if (!$acomment || strlen($acomment = trim($acomment)) > 10){
echo "".$_SESSION['username'].", you have added an award to ".$_POST['awarduser']."'s Profile. ";
mysql_query($query);}
}
else if($submissionFrom == "form2")
{
$query2="INSERT INTO ".TBL_AWARDS." VALUES (NULL, '$type2','$user2', now(), '$comment2')";
// processing logic
if(!$comment2 || strlen($comment2 = trim($comment2)) == 0)
echo "Comment not entered";
else if(!$comment2 || strlen($comment2 = trim($comment2)) < 10)
echo "Comment too short, must be 10 characters at least";
else if (!$comment2 || strlen($comment2 = trim($comment2)) > 10){
echo "".$_SESSION['username'].", you have added recognition to ".$_POST['recuser']."'s Profile. ";
mysql_query($query2);}
}
else
{
echo "Where is this request coming from";
}
?>
Please note that there are ALOT of coding issues with your code. For one, you insert into the database before you do your error checking...