+ Reply to Thread
Results 1 to 6 of 6

Thread: [return_link /] renders but server "Cannot open form url"

  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Default [return_link /] renders but server "Cannot open form url"

    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"&nbsp;  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="&lt;?php echo $protocol . '://' . $host; ?&gt;" />
    <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!
    Last edited by kalanh; 25-Apr-2012 at 09:10 PM.

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: [return_link /] renders but server "Cannot open form url"

    first, can u open a URL to ur template in a normal browser.

    if so,...

    there's a test script called 'testurlopen' which u can get as part of this download:
    http://www.tectite.com/vbforums/show...dler.php-v1.22

    it's a small script, easy to understand.

    after checking it works adjust it to open the URL to ur template

    if it doesn't work, ask ur host why ur server can open any URL (in the universe) except the URLs on ur own website

  3. #3
    Join Date
    Dec 2003
    Posts
    3,979

    Default Re: [return_link /] renders but server "Cannot open form url"

    Hi,

    Thanks for your support subscription.

    As crabtree is alluding, it might be that your server won't open URLs to your own website.

    Please send me access details to your server using this secure form:I'll run some tests to determine what the problem actually is and we'll proceed from there.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Apr 2012
    Posts
    3

    Default Re: [return_link /] renders but server "Cannot open form url"

    It certainly seems that my server refuses to open its own URLs. I tested with testurlopen.php and it opens microsoft.com just fine. I tried on my own server and received the following:

    Code:
    URL open for http://www.example.com/ failed:  failed to open stream: Connection timed out
    URL open for https://secure.example.com/form.php failed:  failed to open stream: Connection timed out
    I tried adjusting the test code to use fsockopen with both tls: and ssl:, but both times received:

    Code:
    fsockopenopen for https://secure.example.com/form.php  failed: unable to connect to  ssl://secure.example.com/form.php:443 (Unknown  error)
    PHP version is 5.1.6.

  5. #5
    Join Date
    Apr 2012
    Posts
    3

    Default Re: [return_link /] renders but server "Cannot open form url"

    In playing with the testurlopen.php script, I found that a relative path actually does work where internal absolute paths fail. I hope this will offer a clue.

    Code:
    /**
     * This test works!
     */
    $fp = fopen('form.php', 'r');
    if ($fp !== FALSE)
    {
        echo "<p>URL open succeeded for form.php (relative path)</p>";
        fclose($fIn);
    }
    else
        echo "<p>URL open for form.php (relative path) failed: $php_errormsg</p>";
    I have opened a support ticket with my hosting company and I am awaiting a response.

  6. #6
    Join Date
    Dec 2003
    Posts
    3,979

    Default Re: [return_link /] renders but server "Cannot open form url"

    Hi,

    That's opening a file not a URL.

    So, that's quite a different situation.

    You need to be able to open the URL to your site so that it looks just like a browser is accessing it.

    (I've also replied to your email contact.)
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. "This URL is a Form submission program." Error
    By Axe in forum Community Support
    Replies: 3
    Last Post: 23-Jan-2010, 09:50 AM
  2. when submit get the "open/save php file" box
    By Digiburd in forum Community Support
    Replies: 0
    Last Post: 15-Jan-2008, 07:29 PM
  3. Does "alert_to" form field use "AT_MANGLE" feature?
    By jennyp in forum Community Support
    Replies: 4
    Last Post: 06-Dec-2006, 12:29 AM
  4. "/tmp/fm6010c9.txt": failed to open stream:
    By NordicProductions in forum Community Support
    Replies: 2
    Last Post: 17-Sep-2006, 03:43 PM
  5. "<return_link/>" not parsed
    By johnny in forum FormMail Subscription Support
    Replies: 4
    Last Post: 19-Jun-2005, 03:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts