|
|
//loop thru all QP_CGI_VARS
$tmp_sendmail=false;
$tmp_msg="";
//save relevant data to db
if($QP_CGI_VARS["ff_action"]=="register") {
$sql="INSERT INTO visitor_account (cdate,site_id,email,fname,lname,zip) VALUES (now(),".$QPO_DB->site_id.",";
$sql.="'".$QP_CGI_VARS["ff_email"]."',";
$sql.="'".$QP_CGI_VARS["ff_forename"]."',";
$sql.="'".$QP_CGI_VARS["ff_lastname"]."',";
$sql.="'".$QP_CGI_VARS["ff_zip"]."')";
error_log($sql);
$new_id=$QPO_DB->insert($sql);
}
elseif($QP_CGI_VARS["ff_action"]=="login") {
include("checklogin.inc.php");
exit();
}
elseif($QP_CGI_VARS["ff_action"]=="kontakt" || $QP_CGI_VARS["ff_action"]=="qpmail" || $QP_CGI_VARS["ff_action"]=="probefahrt" || $QP_CGI_VARS["ff_action"]=="werkstatt" || $QP_CGI_VARS["ff_action"]=="ersatzteile") {
$tmp_counter=0;
while(list($key,$val)=each($QP_CGI_VARS)) {
$key=trim(strtolower($key));
if($key!="ff_action" && $key != "ff_subject" && $key!="ff_redirect") {
if(preg_match("/^ff_/",$key)) {
$tmp_msg.=ucfirst(substr($key,3))." : ".$val."\n";
$tmp_counter++;
}
}
}
if($tmp_counter>0) $tmp_sendmail=true;
}
$do_newsletter=$QP_CGI_VARS["ff_newsletter"];
if(isset($do_newsletter) && !empty($do_newsletter) && $do_newsletter) {
if(!is_object($QPO_NEWSLETTER)) {
#require_once($_SERVER['DOCUMENT_ROOT']."/qp/obj/newsletter.obj");
include_once("./obj/newsletter.obj.php");
$QPO_NEWSLETTER = new newsletter($QPO_DB);
}
if($QPO_UTILS->checkEmailAddress($QP_CGI_VARS['ff_email'])) {
if(!$QPO_NEWSLETTER->existEmailAddress($QP_CGI_VARS['ff_email'])) {
$QPO_NEWSLETTER->addEmailAddress($QP_CGI_VARS['ff_email'],$QP_CGI_VARS['ff_zip']);
}
}
}
if($tmp_msg!="") {
$tmp_msg="Folgende Daten wurden angegeben:\n\n".$tmp_msg;
}
//error_log($tmp_msg);
// send mail
if($tmp_sendmail) {
$headers="";
$headers.="From: ".$QPG_MAIL_FROM."\n";
$mybool=mail($QPG_MAIL_ADDR,$QP_CGI_VARS["ff_subject"],$tmp_msg,$headers);
error_log("formhandler: sending mail to {QPG_MAIL_ADDR}");
}
// redirect
if(empty($redirect_to) || !isset($redirect_to)) $redirect_to=urldecode(stripslashes($QP_CGI_VARS["ff_redirect"]));
error_log("formcontroller: redirect: $redirect_to");
header("Location: $redirect_to");
//echo "gumba";
exit();
?>
| Letztes Update:
print $lastupdate;
?>
© Ing. Erich Mozorits GmbH (by webstuhl.net) |
| |