close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UE & VTK Looping Error

Thread began 3/23/2009 12:08 pm by Martin | Last modified 3/29/2009 8:35 am by Martin | 3346 views | 4 replies |

Martin

UE & VTK Looping Error

Greetings! I have been working with UE & the VTK to create a form that validates itself, jumps to the error on the page, shows conditional validations and when successfully validated sends an e-mail by UE that then redirects back to the page and displays a hidden success message.

I am currently running into an error that I don't know is caused by either VTK or UE.

So when the page URL refreshes on an error it shows like this:

newsletter-sign-up.php#error

When UE successfully sends an e-mail it should show up like this in the URL:

newsletter-sign-up.php?success

which then displays the hidden success message because of the get - success from the URL.

However what I am getting is the following:

newsletter-sign-up.php?success#error

and the e-mail is putting itself into a loop and sending out multiple e-mails...

So it looks like when the e-mail is being successfully sent it is not refreshing the URL and deleting the #error message.

Here is my header

<?php require_once('WA_Globals/WA_Globals.php');?>
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php
if ((((isset($_POST["submit"]))?$_POST["submit"]:"") != "")) {
$WAFV_Redirect = "newsletter-sign-up.php#error";
$_SESSION['WAVT_newslettersignup_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateEM(((isset($_POST["email"]))?$_POST["email"]:"") . "",true,1);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,2);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"newslettersignup");
}
}
?>
<?php require_once("WA_Universal_Email/mail_PHP.php"); ?>
<?php require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>
<?php
if (((((isset($_POST["submit"]))?$_POST["submit"]:"") != ""))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry

//Send Mail All Entries
$RecipientEmail = false;include("WA_Universal_Email/WAUE_newsletter-sign-up_1.php");
if ("newsletter-sign-up.php?success"!="") {
header("Location: newsletter-sign-up.php?success");
}
}
?>

Any help would be appreciated!

FYI, if they fill out the form correctly the first time, it works fine and displays ?success. It is only when we have an error that I run into this problem.

Thanks!

Martin

Sign in to reply to this post

Ray BorduinWebAssist

It is probably automatically appended to the form action. You could most likely remove it from the form action code and it wouldn't be passed along.

Sign in to reply to this post
Did this help? Tips are appreciated...

Martin

So since I am specifying the anchor link in

$WAFV_Redirect = "newsletter-sign-up.php#error";

and the success e-mail redirect in

if ("newsletter-sign-up.php?success"!="") {
header("Location: newsletter-sign-up.php?success");

along with the code you asked me to update in the WAVT_Scripts_PHP.php include (so that the anchor concept would work)

showthread.php?t=227

can I ask where I would exclude it in the form action code so it is not appended as you suggest?

Sign in to reply to this post

Ray BorduinWebAssist

What is the action of the form on the page. It might not even be the problem, that is just a guess.

Sign in to reply to this post
Did this help? Tips are appreciated...

Martin

Seems to be working now??

Strange, I checked this out and tested it on the live server. It seems to be working fine now. Refreshing the page and altering the URl appropriately.

Thanks for your help. I will let you know if this occurs again.

Cheers,

Martin

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...