// Start of actual processing of data.
if( $REQUEST_METHOD == "POST" )
{
if( strlen( $name ) == 0 || strlen( $name ) > 40 )
{
printf( "Oops! The name field is not option and has a maximum length of 40 charaters.Please push back and try again." );
/***************************************************************************************/
// Data validation.
if( strlen( $body ) == 0 || strlen( $body ) > 10000 )
{
echo( "Oops! The body field is not optional and can has a maximum length of 10000 charaters. Please push back and try again." );
}
/***************************************************************************************/
// More data validation.
if( strlen( $subject ) == 0 || strlen( $subject ) > 40 )
{
printf( "Oops! The subject field is not option and can only be a maximum of 40 charaters. Please push back and try again." );
exit( );
}
/***************************************************************************************/
} // End of data validation.
/***************************************************************************************/
// If all data passes tests, proceed with insert.
else {
// Actual query / insert...
$News_Result = mysql_db_query( $Database, "$News_Query", $DBConnection );
// $MsgBoard_Result = mysql_db_query( $Database, "$MsgBoard_Query", $DBConnection );
// Some quick validation / error handling.
// if( !$News_Result || !$MsgBoard_Result )
if( !$News_Result )
{
printf( "Something went wrong when trying to insert news." . mysql_error() . "\n" );
exit( );
} // End of insertion phase.
} // End of else ...
} // End of if( request_method == "post" ).