1
I am trying to make a custom form system work with DuGris' SecurityImage class ver.1.6 and module ver.1.0beta4
Im using XOOPS ver. 2.2.2 with php5 installed.
I followed the instructions on DuGris' site on Installing and inserting the code in my forms:
http://www.dugris.info/modules/news/article.php?storyid=1&page=2http://www.dugris.info/documentations/article.php?storyid=1&page=3He says to insert the following code before and after the submit button. I tried doing that and every time i go on any form page that i created, it refreshes immediately to tell me Security Token Invalid and redirects me to my redirect link.
minaform.phple="color: #000000"><?php include_once XOOPS_ROOT_PATH."/class/xoopsobject.php"; include_once XOOPS_ROOT_PATH."/modules/accedian/class/IdgObjectHandler.php"; include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; abstract class MinaForm extends XoopsObject { function MinaForm (){} function getForm(){ $form = new XoopsThemeForm($this->getFormTitle(), 'new_product', 'index.php', 'POST'); if($this->hasComment()){ $this->addCommentField($form); } //DuGris Code***************** if (defined('SECURITYIMAGE_INCLUDED')) { $security_image = new SecurityImage( _SECURITYIMAGE_GETCODE ); if ($security_image->render()) { $form->addElement($security_image, true); } } //DuGris Code***************** $operationTray = new XoopsFormElementTray(''); $operationTray->addElement(new XoopsFormButton('', 'submit_product', 'Submit', 'submit')); $form->addElement($operationTray); //DuGris Code***************** include_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php"); if ( defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) { redirect_header(XOOPS_URL."/modules/accedian/", 2, _SECURITYIMAGE_ERROR); exit(); //DuGris Code***************** return $form; }
Anyone would know what would be the cause of the security token being invalid if i didn't even submit the form yet?Any help would be appreciated, i've been struggling with this issue for a long time.
Thanks.
Patrick S.