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

redirecting form to the same page

Thread began 9/25/2013 3:08 pm by Jamie | Last modified 9/26/2013 5:25 am by Jamie | 453 views | 4 replies |

Jamie

redirecting form to the same page

Hey Jason

Am trying to get a contact form to redirect to itself on success and show 'success' content instead of the form.

The form itself is working and it redirects back to the contact page but it continues to show the form rather than the success content... not sure what I have missed.

Many thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

well, your using a session for the if statement, so make sure to start the session:
<?php @session_start(); ?>

if that still doesnt work, dump the session:

<?php var_dump($_SESSION); ?>

and make sure you have the correct session name

Sign in to reply to this post

Jamie

is this what you mean?

<?php 
if (isset($_POST["SimpleContact_submit_x"])) {
$WAFV_Redirect = "".(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)) ."?invalid=true";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ((isset($_POST["Name"])?$_POST["Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM((isset($_POST["Email"])?$_POST["Email"]:"") . "",true,2);
$WAFV_Errors .= WAValidatePN((isset($_POST["Telephone"])?$_POST["Telephone"]:"") . "",false,true,true,3);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}
}
?>



I am using code from another site I did a little while ago and am re-using the code for this from that....that being the case, am not sure what I need to change t be in line with the current site setup...

Sign in to reply to this post

Jason ByrnesWebAssist

no, that's not what I mean at all.

the if statement to show the message is:

<?php if(isset($_SESSION["waue_contact-us1_1_Status"]) && $_SESSION["waue_contact-us1_1_Status"] == "Success") { ?>

so make sure you have the correct session name by using the var dump. Is that the session returned by the var dump? is the value in the dump for that session Success?


and make sure you have the session start line.

Sign in to reply to this post

Jamie

got it. needed to redo the form but got it working.

thanks

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