My form is 99% complete. The autoresponder works, the mail templates work, form validation works, sessions are being used, it's all good. The only problem is with [return_link /] fmbadhandler: it renders properly as a link to the correct URL, and while it works on my local WAMP server it times out on the RHEL 5 production server with the following message:
Code:
Cannot open form URL: https://secure.advisormarketing.ca/service-agreement.php?USER_AGENT=Mozilla%2F5.0+%28compatible%3B+MSIE+9.0%3B+Windows+NT+6.1%3B+WOW64%3B+Trident%2F5.0%3B+MAAU%29&sessid=2ai8ohtqf8m65j8h7v0k95vm24&:
I have most of my form validated from formval.js, but because I need an autoresponder I have to also have reCaptcha. I'm trying to avoid jumping to fmbadhandler because I the [return_link /] times out on my production server, even though I've set fopen_url is on, and both this_form and $TARGET_URLS are dynamically configured to cover my development and live servers. I have tried with and without a manually-set session name in both formmail.php and fmbadhandler.php and my form and template permissions are set to 755.
http://www.tectite.com/vbforums/show...for-badhandler
http://www.tectite.com/vbforums/show...rom-returnlink
Code:
<form method="post" action="formmail.php?<?php echo SID; ?>" id="serviceAgreementForm">
<div>
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
Code:
<input type="hidden" name="recipients" value="alan_at_advisornet.ca" />
<input type="hidden" name="required" value="imageverify:10) Image Verification" /
<input type="hidden" name="autorespond" value="HTMLTemplate=service-agreement-autorespond-template.php,Subject=Service Agreement Confirmation,TemplateMissing=NoTemplate,FromAddr=support_at_example.ca,TemplateMissing=n/a" />
<input type="hidden" name="good_template" value="confirmation-service-agreement.php" />
<input type="hidden" name="bad_template" value="service-agreement-error.htm" />
<input type="hidden" name="bad_url" value="/fmbadhandler.php" />
<input type="hidden" name="this_form" value="<?php echo $protocol . '://' . $host; ?>/service-agreement.php" />
<input type="hidden" name="subject" value="Service Agreement" />
<input type="hidden" name="website" value="<?php echo $protocol . '://' . $host; ?>" />
<input type="hidden" name="derive_fields" value="arverify=imgverify" />
<input type="hidden" name="mail_options" value="HTMLTemplate=service-agreement-template.htm,NoEmpty" />
Code:
<img src="verifyimg.php<?php echo SID; ?>" alt="Image verification" id="vimg" />
<p>For your security, please enter the characters you see in the image:</p><br>
<div class="center-align">
<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6LfOm9ASAAAAAGK6agymquukjAb0QaEpcjawcita"></script>
</div>
I've heard of people miraculously fixing things like this by setting a relative path to an absolute path or vice versa, but I with it wasn't so finicky! I have set $use_ssl to true in the recaptcha_get_html() function in recaptchalib.php:
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = true)
http://www.tectite.com/vbforums/showthread.php?5482-reCaptcha-verification-failed-(invalid-request-cookie)
I checked the fmbadhandler source code, and the problem originates in the function UnCheckStuff($s_buf). On line 1710, fmbadhandler.php has:
Code:
$sFormBuf = GetURL($sFormURL);
if ($sFormBuf === false)
ReportError("Cannot open form URL: $sFormURL: $php_errormsg");
In my case, perhaps my secure server isn't passing along the session properly (although the session ID is clearly visible in the return url). I also tried allowing full access to my form via .htaccess as outline in the fmbadhandler documentation at the top. I welcome any and all tips!
Bookmarks