'All Newsletter Optin Form', //pageName, ie. All Newsletter Optin Form, All Newsletter Optin Form 'product' => 'All Newsletter Optin Form', //product, ie. Showcase 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 All 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 `showcase_newsoptin`(`signup_date`, `first_name`, `last_name`, `phone`, `mobile_phone`, `email_address`, `message`, `re_news`, `b_news`, `jlb_news`, `pc_news`, `Grand_news`, `events`) VALUES ('$date','{$cleanData['fname']}','{$cleanData['lname']}','{$cleanData['phone']}','{$cleanData['mobile_phone']}','{$cleanData['email_address']}','{$cleanData['message']}','{$cleanData['re_news']}','{$cleanData['b_news']}','{$cleanData['jlb_news']}','{$cleanData['pc_news']}','{$cleanData['Grand_news']}','{$cleanData['events']}')"; $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']); $cleanData['message'] = $lowerFilter->filter($filterChain->filter($data['message'])); $cleanData['subscribe'] = $lowerFilter->filter($filterChain->filter($data['terms'])); $cleanData['re_news'] = $lowerFilter->filter($filterChain->filter($data['RE-News'])); $cleanData['b_news'] = $lowerFilter->filter($filterChain->filter($data['Builder-News'])); $cleanData['jlb_news'] = $lowerFilter->filter($filterChain->filter($data['JLB-News'])); $cleanData['pc_news'] = $lowerFilter->filter($filterChain->filter($data['PC-News'])); $cleanData['Grand_news'] = $lowerFilter->filter($filterChain->filter($data['Grand-News'])); $cleanData['events'] = $lowerFilter->filter($filterChain->filter($data['Events'])); return $cleanData; } ?> Showcase App Download Today! | Tell us what you think?

Showcase Feedback | News & Event Sign-up

visit news-press.com   |   connect: facebook

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Stay informed with The News-Press' specialty newsletters. Select, subscribe and enjoy any or all of these newsletters, provided by The News-Press.
 
 
 
 
 
 
 
 
 
 
 

Showcase News & Event Sign-up

visit news-press.com   |   connect: facebook


Thank you! Your information has been added and your message has been received. If you have requested assistance with our products or services a representative will contact you within 24hrs.