form action bypassing page I want
I have product pages and at the bottom of each bottom page, There is a submit button with action to go to a quote request page. This is the action:
<form action="quote_form.php?pdf_ID=60" method="post" id="form1">
<input name="submit1" type="image" id="submitimg" src="images/quote.jpg" alt="Request Quote" />
On the quote_form.php page I have a form and a recordset with a GET variable to receive the ?pdf_ID=60 and the recordset populates a menu list from the pdf_ID.
The form should send an email with the person's info and the product that they want a quote. The email redirect to ?success=true which would show a message on the page that the email has been sent.
I recently upgraded this page to the most recent webassist email version and now when the form action button on the product page is pressed it bypasses the quote form page and goes directly to the ?success=true and no email is sent?
Code from the quote_form.php
<?php require_once("webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php require_once('Connections/connsqli.php'); ?>
<?php
if (($_SERVER["REQUEST_METHOD"] === "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$WAFV_Redirect = "";
$_SESSION['WAVT_quoteform_591_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["name1"]))?$_POST["name1"]:"") . "",false,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["email1"]))?$_POST["email1"]:"") . "",true,2);
$WAFV_Errors .= WAValidatePN(((isset($_POST["phone1"]))?$_POST["phone1"]:"") . "",true,false,true,3);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["company1"]))?$_POST["company1"]:"") . "",false,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["quote_model"]))?$_POST["quote_model"]:"") . "",false,5);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["message1"]))?$_POST["message1"]:"") . "",false,6);
$WAFV_Errors .= WAValidateLE(strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",strtolower($_SESSION['captcha_Security_Code_1']) . "",true,7);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"quoteform_591");
}
}
?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$rs_kaeser = new WA_MySQLi_RS("rs_kaeser",$connsqli,0);
$rs_kaeser->setQuery("SELECT * FROM kaeser_models WHERE pdf_ID = ?");
$rs_kaeser->bindParam("i", "".$_GET['pdf_ID'] ."", "-1"); //var1
$rs_kaeser->execute();
?>
<?php require_once("webassist/email/WA_Email.php"); ?>
<?php
if (isset($_POST["submit1"]) || isset($_POST["submit1_x"])) { //WA Universal Email
$Email = new WA_Email("quote_form_2");
$Email->Redirect = "?success=true";
$Email->From = "".((isset($_POST["name1"]))?$_POST["name1"]:"") ." <".((isset($_POST["email1"]))?$_POST["email1"]:"") ."";
$Email->addTo("joef@airpowerservicesinc.com");
$Email->addTo("jb@jbwebworks.com");
$Email->BodyFile = "webassist/email/waue_quote_form_1_body.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "Quote Request from the website";
$Email->send($emailGroup);
}
$Email->close();
}
?>