hi krobi.
It is not so easy to explain how to use a library
gticket2 is almost the same as gticket.
- include_once it
- add hidden into your form
- add check() into your transaction
form side with XoopsForm:
$form = new XoopsThemeForm( ... );
$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ , 1800 , '(your area name)' ) ;
form side with plain HTML:
$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , '(your area name)' )
transaction side:
if ( ! $xoopsGTicket->check( true , '(your area name)' ) ) {
redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
}
If an error occurs in cheking the ticket, "repost form" is displayed automatically.
If you don't want to display "repost form", call check() like this.
if ( ! $xoopsGTicket->check( true , '(your area name)' , false ) ) {
redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
}