query($q); $dbtemp->next_record(); // get page data: $db = new ps_DB; $q = "SELECT * "; $q .= "FROM cms_pages "; $q .= "WHERE name = '".$page."' "; $q .= "And menu_active = 1 "; $q .= "LIMIT 1"; $db->query($q); // redirect if page not found: if(!$db->next_record()){ header("location:index.html"); } // include header: $page_title = $db->f("page_title"); $page_description = $db->f("content1"); $page_keywords = $db->f("content2"); $subtitle = $db->f("page_subtitle");//for sub title. $skin = $dbtemp->f("name"); $title = $db->f("menu_title"); // for h1 page title. include("skins/".$skin."/templates/inc_header.php"); ?>
p("content0")?>

$_POST[contact_reason]"; } $form = "
Contact Credit Provide

Your Name
Your Email Address
Reason for Contact
Message
 
"; // send email... function check_email($str) { //returns 1 if valid email, 0 if not if(ereg("^.+@.+\\..+$", $str)) return 1; else return 0; } // form submited? if($_POST[Submit] == "Send"){ // all fields filled? if (!$_POST[name] || $_POST[contact_reason]=="Default" || !check_email($_POST[email])){ $error = "* Please fill in all fields below" ; } else { // vars // name of site $sitename = "Credit Provide form"; // admin email $admin = "staff@creditprovide.com"; // date $todayis = date("l, F j, Y, g:i a") ; // notes - remove url encoding $send_notes = stripslashes($notes); // footer $messagefooter = " -----------------------------\n sent: $todayis "; // base message to send $messageis = "Credit Provide name: $_POST[name]\n email: $_POST[email]\n Contact Reason: $_POST[contact_reason]\n Comments:\n$send_notes\n ".$messagefooter . ""; $from = "From: $_POST[email]\r\n"; // send if(mail($admin, $sitename, $messageis, $from)){ $is_sent = 1; } if($is_sent){ $error = "Thank You - your message was sent"; } else { $error = "* Sorry - your email was not sent, please try again"; } echo $error; } } if(!$is_sent){ print "$form"; } ?>