close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Contact form not working now in its true home

Thread began 7/18/2009 9:22 pm by dncnkt | Last modified 7/20/2009 3:15 pm by dncnkt | 4024 views | 8 replies |

dncnkt

Contact form not working now in its true home

I previously uploaded my website to my test server and got my contact form working perfectly.

I just uploaded it to it's true home and the form allow you to fill it out, the CAPTCHA letters are appearing but when I hit submit, it just clears the form and no mail is submitted and the thank you page does not appear. Any ideas?

One suggestion on the host's website was to put a line of code in the form replacing "your home directory path" with the actual path. I don't have a clue where to put this or if it is needed. I didn't need it on my other server (different host). I have a choice of PHP4 or 5, and don't know which is best. The line of code is below:

session_save_path("your home directory path"/cgi-bin/tmp);
session_start();

The url is contactus.php

Please help ASAP!

Sign in to reply to this post

Ray BorduinWebAssist

It is probably the referrer checking in the code not passing.

I'd add debug code below the IF statement used to send the email... most likely you should adjust to use an IF statement that does not check the referrer.

If you post the IF statements from your code I can try to give you suggestions for how to fix the problem.

You should probably also remove onsubmit="" from your form tag.

Sign in to reply to this post
Did this help? Tips are appreciated...

dncnkt

Ray, I don't know anything much about php, which is why I purchased this this solution. I follow directions really well however, if they are specific! Can you tell me what the debug code should be and exactly where it should be placed? Thanks very much!

Sign in to reply to this post

Ray BorduinWebAssist

Look for the lines of code that begin with IF and refer to the POST. Paste them here and I can try to help.

Sign in to reply to this post
Did this help? Tips are appreciated...

dncnkt

Ray, here are the lines of code you requested from contactus.php. There were two sections that started with IF and referred to POST and I have included them both here.
Thanks for your help. Katie

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,4);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,5);
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}
}
?>
<?php
if ((($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".($WAGLOBAL_Contact_Email_To) ."";include("WA_Universal_Email/WAUE_contact_1.php");

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

Sign in to reply to this post

Ray BorduinWebAssist

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))) {

to:

if ($_SERVER["REQUEST_METHOD"] == "POST") {

Sign in to reply to this post
Did this help? Tips are appreciated...

dncnkt

I changed the code as requested but the behavior of the form doesn't appear to have changed. It resets the form, doesn't change it to the thank you page, and doesn't send an email.

Sign in to reply to this post

Ray BorduinWebAssist

It must be failing validation somehow....

Update:

$WAFV_Redirect = "";

to:

$WAFV_Redirect = "contactus.php?failed=true";

That will tell us if it is failing validation for some reason or if there is another problem.

Sign in to reply to this post
Did this help? Tips are appreciated...

dncnkt

Jason helped me resolve this in a webconnect session. Turns out the host has "issues" with session management but Jason was able to provide a workaround. This was as I suspected since it worked perfectly on my testing server. Thanks for your help.

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