Location: PHPKode > projects > GolfstatsPHP > golfstatsphp_3.0/addmessage.php
<?
include("dbasecon.inc.php");
include("session.inc.php");
include ("header.php");
include_once "sf.php";



if ($HTTP_POST_VARS['addmsg']) {

if ($reqmsgbody) {



$error="Message posted. Click on 'Home' in navigation menu to go back.";

//format date
$today=date("Y-m-d");                           
$time=date("H:i:s");                           
$insertsql="INSERT INTO msgboard (date, msgtime, userid, message) VALUES ('$today','$time', '$login_id', '$reqmsgbody')";
$insertquery=mysql_query($insertsql);


} else {

$error="No message posted.";


}//endif msgbody


} //endif post vars set game

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<? showheader("Add Message"); ?>
<font class="heading">Add Message</font>
<p>
<? echo "<font class='error'>$error</font>"; ?>
<p>

<form  method="post" action="<?=$PHP_SELF?>" onSubmit="return checkrequired(this)">
<table border="0" cellpadding="5" cellspacing="5">
<tr><td>
Message
</td>
<td>
 <TEXTAREA name="reqmsgbody" rows="10" cols="50"><?echo $reqmsgbody;?></TEXTAREA></TD></TR>
    </td>
</tr>

<tr>
<td>&nbsp;</td>
<td>
<input type="Hidden" name="username" value="<?echo "$name &nbsp;"; echo "$surname";?>">
<input type="Hidden" name="gameorgid" value="<?echo "$gameorgid";?>">
<input type="Hidden" name="action" value="<?=$action;?>">
<input type="Submit" name="addmsg" value="Submit">
</td>
</table>

<p>
</form>



<? showfooter(); ?>
Return current item: GolfstatsPHP