close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Thank you page

Thread began 2/13/2013 3:17 pm by JamieEff | Last modified 2/14/2013 4:14 pm by Jason Byrnes | 1172 views | 19 replies |

JamieEff

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

Sign in to reply to this post

Jason ByrnesWebAssist

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:
<?php if(isset($_GET['sent']) && $_GET['sent'] == "true") { ?>

Thank you message
<?php } else { ?>
<form>
<?php ?>
Sign in to reply to this post

JamieEff

Thanks Jason

Would a page with that sort of path retain a navigation 'on state' for that page if its been set?

Sign in to reply to this post

Jason ByrnesWebAssist

it should, yes.

Sign in to reply to this post

JamieEff

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

Sign in to reply to this post

Jason ByrnesWebAssist

it should retain the on state, can you send a link where i can see the issue please

Sign in to reply to this post

JamieEff

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...

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

JamieEff

here you go Jason

Attached Files
contact.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Ok, so line 50 setts the $EmailRef variable which is a unique reference to the UE instance on this page

php:
$EmailRef = "waue_contact_1";




line 118 uses that $EmailRef variable in the name of the status session:

php:
$_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:
<?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']); ?>
Sign in to reply to this post
loading

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...