email()->validate('user-email'); // check for errors if ($validator->hasErrors()) { $_SESSION['errors']['special-offer-sign-up'] = $validator->getAllErrors(); } else { /* Database insert (disabled for demo) */ /*require_once rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . '/phpformbuilder/database/db-connect.php'; require_once rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . '/phpformbuilder/database/Mysql.php'; $db = new Mysql(); $insert['ID'] = Mysql::SQLValue(''); $insert['user_first_name'] = Mysql::SQLValue($_POST['user-first-name']); $insert['user_name'] = Mysql::SQLValue($_POST['user-name']); $insert['user_email'] = Mysql::SQLValue($_POST['user-email']); if (!$db->insertRow('YOUR_TABLE', $insert)) { $user_message = '
' . $db->error() . '
' . $db->getLastSql() . '
Thanks for suscribe !
' . "\n"; Form::clear('special-offer-sign-up'); }*/ Form::clear('special-offer-sign-up'); // just for demo ; delete this line if real database recording. $user_message = 'Thanks for signing up !
' . "\n"; // just for demo ; delete this line if real database recording. } } /* ================================================== The Form ================================================== */ $form = new Form('special-offer-sign-up', 'horizontal', 'novalidate', 'foundation'); // $form->setMode('development'); $form->setCols(0, 6); $form->addHtml('