'JLB Newsletter Optin Form', //pageName, ie. JLB Newsletter Optin Form, JLB Newsletter Optin Form 'product' => 'JLB Newsletter Optin Form', //product, ie. JLB Newsletter Optin Form 'section' => 'Section', //section, ie. Front, Section, Video, Gallery 'contentType' => 'Section', //contentType ie. Front, Section, Video, Gallery ); // Get Html class for header, footer, etc. $html = new Np\Html\Template('news-press.com JLB Newsletter Optin Form',$props); $oas = new Np\Html\Oas(); $flag = false; if($_POST) { // Get Database connection $db = getDb(); $cleanData = cleanUserData($_POST); $date = date('Y-m-d'); $sql = "INSERT INTO `jlb_newsoptin`(`signup_date`, `first_name`, `last_name`, `phone`, `mobile_phone`, `email_address`) VALUES ('$date','{$cleanData['fname']}','{$cleanData['lname']}','{$cleanData['phone']}','{$cleanData['mobile_phone']}','{$cleanData['email_address']}')"; $db->query($sql); $flag = true; } /** * Get a database connection */ function getDb() { $config = Zend_Registry::get('config'); $db = new Np\Db\NpDb($config); $db->connect('dms_services'); return $db; } /** * Clean the user data removing unneeded data * @param array $data An array of the user data * @return array The cleaned data */ function cleanUserData($data) { $cleanData = array(); $digitFilter = new Zend_Filter_Digits(); $lowerFilter = new Zend_Filter_StringToLower(); // Create a general filter for all fields $filterChain = new Zend_Filter(); $filterChain->addFilter(new Zend_Filter_StripTags()) ->addFilter(new Zend_Filter_StripNewlines()) ->addFilter(new Zend_Filter_StringTrim()); // Filter the data $cleanData['fname'] = $lowerFilter->filter($filterChain->filter($data['FirstName'])); $cleanData['lname'] = $lowerFilter->filter($filterChain->filter($data['LastName'])); $cleanData['email_address'] = $lowerFilter->filter($filterChain->filter($data['Email'])); $cleanData['mobile_phone'] = $filterChain->filter($data['MobilePhone']); $cleanData['phone'] = $filterChain->filter($data['Phone']); return $cleanData; } ?>

visit news-press.com

connect: facebook

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Thank you! Your information has been added to receive the Jean Le Boeuf Newsletter.