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

Form not re-directing to thank you

Thread began 4/02/2009 7:35 pm by mcdonald310584 | Last modified 4/07/2009 10:59 am by mcdonald310584 | 2888 views | 10 replies |

Peter

Form not re-directing to thank you

I have created a form from the solution pack. On my remote server it operates fine and re-directs to the thank you page after submitting the completed form. I've set up a local testing server on my computer using the xampp for windows (I have xp pro) which installs Apache, PHP, and MySQL. Everything seems to be running fine there but when I bring up the form page in the local server, then submit it seems to just refresh the form page with blank fields rather than submitting and re-directing to the thank you page. Any thoughts on what I might look for to make this work on the local server like it does so well on the remote one? Any help is really appreciated.
Peter

Sign in to reply to this post

Ray BorduinWebAssist

Probably a local firewall preventing the referral checking. You can update the IF statement and remove the referral checking portion...

in other words update:


if ((($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST))) {

and make it:
if ($_SERVER["REQUEST_METHOD"] == "POST") {

Sign in to reply to this post

Peter

Ray unless I'm looking in all the wrong places, the existing code seems to match your solution already. Here's an excerpt from the php code early in the file with the relevant line right after the opening tag:

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//WA Universal Email object="Mail for Linux"
//Send Loop Once Per Entry
$RecipientEmail = "".($WAGLOBAL_Email_To) ."";include("WA_Universal_Email/WAUE_contact_1.php");

//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");
}
}
?>

I'm a real neophyte with php code so I don't know for sure if I'm looking in the right place. What do you think?

One interesting twist: I thought I could just shut down my zonealarm (firewall) and problem solved. It actually did have some effect. The page didn't re-direct but the entries for the contact and message boxes remained. the captcha and random ? entries were gone. So different, but not yet fixed. Why would it not work to just shut down my firewall if that was the problem. It seems like a more straightforward thing for me to do when using the local server for testing. Rather than have to edit code... and know which code to edit.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like it is updated. Turning off the firewall is of course an option. The captcha and random question entries are supposed to be gone, since they change each time there is no benefit to keeping them.

Sign in to reply to this post

Peter

Thanks for the confirmation. My issue remains unresolved however and we seem to be back to square one. That is, the form is not functioning properly using a local testing server in that it is not re-directing to the thank you page. The testing server itself seems to be operating just fine. Do you have any suggestions for a plan B, tech support, or anything else I might try?
Peter

Sign in to reply to this post

Ray BorduinWebAssist

If you move the redirect to the first line of code on the page will it redirect:

<?php
header("Location: thankyou.php");
die();
?>

my guess is there is another error before the redirect preventing it from being successful. By starting on the first line and moving it down, you may be able to determine where the problem begins and then how to fix it.
If not

Sign in to reply to this post

Peter

Next?

OK your code looks a little different. I don't have the "die" thing. I copied your code into that first line and the browser went directly to the thank you page. When I put the code anywhere else in that block, it goes to the contact form page and doesn't re-direct. Is there a next step to try?

Sign in to reply to this post

Ray BorduinWebAssist

Do you have spaces or a blank line on top of the document?

Sign in to reply to this post

Peter

Aaaarrgghh this is where this form of communication can get pretty inefficient. Not that I don't appreciate you hanging in there with me. If you mean the contactus.php file, there is nothing but code all the way up to the top. No spaces or blank lines. If you mean something else, please be more specific.

Sign in to reply to this post

Ray BorduinWebAssist

You should post a support incident. That will allow you to share files and speak over the phone with a webasisst engineer.

If a line of code works on the first line and not on the second, then something on the first line is causing the problem. If you can't debug php, then you will probably need someone who can to help directly.

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