email redirect and mod rewrite pages
Hi Ray
Have got a contact form set up which redirects to itself on both validation fail and success...this is fine on a static page but on a dynamic mod rewritten page, it doesnt redirect to the mod rewritten value but the actual filename itself.
If I echo SERVER_URI to the page it shows the mod rewritten value but the redirect doesnt.
the validation is
<?php
if (isset($_POST["ContactForm"]) || isset($_POST["ContactForm_x"])) {
$WAFV_Redirect = "".$_SERVER['REQUEST_URI'] ."#validfail";
$_SESSION['WAVT_contactform_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ((isset($_POST["Name"])?$_POST["Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateRQ((isset($_POST["Telephone"])?$_POST["Telephone"]:"") . "",true,2);
$WAFV_Errors .= WAValidateEM((isset($_POST["Email_Address"])?$_POST["Email_Address"]:"") . "",true,3);
$WAFV_Errors .= WAValidateRX(((isset($_POST["emailx"]))?$_POST["emailx"]:"") . "","/^$/i",false,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Area_of_Interest"]))?$_POST["Area_of_Interest"]:"") . "",false,5);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contactform");
}
}
?>
and the email side of things is
<?php
if (isset($_POST["ContactForm"]) || isset($_POST["ContactForm_x"])) { //WA Universal Email
$Email = new WA_Email("waue_sayhello_1");
$Email->Redirect = "".$_SERVER['REQUEST_URI'] ."?sent=1&#success";
$Email->From = "College Chambers <noreply@motley.site>";
$Email->Importance = "1";
$Email->BurstSize = "200";
$Email->BurstTime = "1";
$Email->WaitTime = "1";
$Email->addTo("jamie@motley.co.uk");
$Email->BodyFile = "webassist/email/templates/Blank.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 = "Website Enquiry";
$Email->send($emailGroup);
}
$Email->close();
}
?>
Have put a link to a mod rewritten page in the PM and if you scroll down you will see the form on the page
TIA
Jamie