close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

embedded form well - how to get thankyou to appear in the form itself?

Thread began 3/31/2010 4:44 pm by pete | Last modified 5/20/2011 2:52 pm by Jason Byrnes | 1421 views | 5 replies |

pete

embedded form well - how to get thankyou to appear in the form itself?

I've embedded the form nicely in my existing page and the email is working well.

I'd like to have a "thank you" appear in the <div> that houses the form, rather than on a new page - the difficulty is that the form is on my home page, so I don't necessarily want people to leave it after a successful form submission.

The old way I could do is to create a "thank you page" styled in the manner of the site, then use an x-seconds redirect to go back to the home page, but there must be something just a bit more impressive available...

Thanks,
Pete

Sign in to reply to this post

Jason ByrnesWebAssist

in the server behavior that will process the form, sending an email or storing the information in a database, set the redirect to go back to itself using a querystring variable, example:
index.php?proc=1


you can then use an if statement to display the form or the thank you message based on the querystring variable:

php:
<?php if(isset($_GET['proc']) && $_GET['proc'] == 1) { ?>
Form was submitted message
<?php } else { ?>
Form here
<?php ?>
Sign in to reply to this post

warrencindy368082

Jason,

I would like the ThankYou in the div on the form page. What steps would I take to make this happen?

Warren

Sign in to reply to this post

Jason ByrnesWebAssist

set the redirect for the universal email behavior as outlined previously, then add the if statement inside your div:

php:
<?php if(isset($_GET['proc']) && $_GET['proc'] == 1) { ?>

Form was submitted message
<?php ?>
Sign in to reply to this post

Peaces

Thanks for the reply.

Please forgive my ignorance.

Where/what location do I put:
index.php?proc=1

Is it part of:
//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");
}

Sign in to reply to this post

Jason ByrnesWebAssist

change:
header("Location: thankyou.php");

to:
header("Location: thankyou.php?proc=1");

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