Hi
I want to check is somebody already subscribed, the form then should give a message, Sorry, you already subscribed and the form should be "stopped"
I added a new event in the Eventswitcher, called "ingeschreven"
In this event I added a Systemmessage and a Stopper
In the PHP field I put this code
But the form does not stop, and no systemmessage
Note: I check on "Datum" and "email"
Both fields are in the form en DB table
Where am I going wrong?
I want to check is somebody already subscribed, the form then should give a message, Sorry, you already subscribed and the form should be "stopped"
I added a new event in the Eventswitcher, called "ingeschreven"
In this event I added a Systemmessage and a Stopper
In the PHP field I put this code
$datum = JRequest::getString('Datum', '', 'post'); $user_info = JRequest::getString('email', '', 'post'); if ( $datum && $user_info ) { $db =& JFactory::getDBO(); $query = " SELECT COUNT(*) FROM `nestv_chronoengine_chronoforms_data_basic` WHERE `Datum` = '{$datum}' AND `email` = '{$user_info}'; "; $db->setQuery($query); $count = $db->loadResult(); if ( $count > 0 ) { return "ingeschreven"; }
But the form does not stop, and no systemmessage
Note: I check on "Datum" and "email"
Both fields are in the form en DB table
Where am I going wrong?