Thank you page
hey Jason
I know how to redirect a form on submit to a different page but just wondering if I am able to make the form open the 'thank you' in the same page as the form itself (and hide the form on successful submit)?
Thanks
Jamie
hey Jason
I know how to redirect a form on submit to a different page but just wondering if I am able to make the form open the 'thank you' in the same page as the form itself (and hide the form on successful submit)?
Thanks
Jamie
you could do this by passing a UEL parameter in the universal email redirect:
pagename.php?sent=true
then use an if statement around the form to show the thank you message if the url variable equals true, or show the form if not:
<?php if(isset($_GET['sent']) && $_GET['sent'] == "true") { ?>
Thank you message
<?php } else { ?>
<form>
<?php } ?>
Thanks Jason
Would a page with that sort of path retain a navigation 'on state' for that page if its been set?
thanks for all your help.
Unfortunately it doesnt retain the on state with this method... but its a lesson I have been looking to learn for some time so a big thanks for your help on that
Jamie
it should retain the on state, can you send a link where i can see the issue please
here you go
contact page itself: contact.php - as you can see the contact nav has got a purple tab/background
the thank you 'page' contact.php?sent=true the purple tab/background on the contact navigation no longer there...
interesting, well, there is more than one way to skin a cat....
instead of using the URL variable, UE creates a session that contains the status of sending the email.
you can use the session in the if statement instead of passing the URL variable.
send a copy of your page and I can see the session name to give the session based code.
Ok, so line 50 setts the $EmailRef variable which is a unique reference to the UE instance on this page
$EmailRef = "waue_contact_1";
line 118 uses that $EmailRef variable in the name of the status session:
$_SESSION[$EmailRef."_Status"] = $GLOBALS[$EmailRef."_Status"];
so for this page the session is named
waue_contact_1_Status
posible values are "Success" or "Failure", it will equal Success if the email was compiled and passed to the SMTP server. It will equal Failure if the SMTP server could not be connected to, or there was a problem with the format of the from or to addresses.
so we can change the if statement to use the status session as a trigger, we will also want to clear the status session so that a page reload will show the form:
<?php @session_start(); ?>
<?php if(isset($_SESSION['waue_contact_1_Status']) && $_SESSION['waue_contact_1_Status'] == "Success") { ?>
Thank you message
<?php } else { ?>
<form>
<?php } ?>
<?php if(isset($_SESSION['waue_contact_1_Status'])) unset($_SESSION['waue_contact_1_Status']); ?>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.