function exit_error ( $msg ) {
echo "Please fix the following errors and try to submit your joke again:
". $msg . "
";
exit();
}
if( $_REQUEST['action'] == "addjoke" ) {
$ac=$_REQUEST['action'];
$_REQUEST['action']="login";
if ( $_REQUEST['submittimesga'] >= 3 )
exit_error ( "
You cant submit more than 3 jokes in 24 hours.
" ); else if ($jokecategory==blank) exit_error ( "Please choose a category.
" ); else if ( empty( $joketitle ) ) exit_error ( "Please insert Joke Title.
" ); else if ( empty( $joketext ) ) exit_error ( "Please insert the Joke body.
" ); else if (strlen($joketitle)>30) exit_error ( "Title can not be longer than 30 letters
" ); else { setcookie('submittimesga',$_REQUEST['submittimesga']+1,time()+86400); $_REQUEST['action']=$ac; } } ?>![]() |
|
|
|