+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: HTML Template for error handling

  1. #1
    Join Date
    Jul 2005
    Posts
    28

    Default HTML Template for error handling

    I know I saw this on your website here someplace, but I cannot find it again to save my soul. I need the variable I should use in our HTML Template that causes fmbadhandler.php to insert the error code and associated message in it for the bad_url call.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: HTML Template for error handling

    Hi,

    Have a look through the HOW TO guide: http://www.tectite.com/fmhowto/adverror.php
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    OK, thanks. I have another problem now, I'm not sure how to resolve it:

    My HTML Template is "error.htm"

    I can access it via browser OK:
    http://www.spiritheart.org/fm_templates/error.htm

    When I submit a form:
    http://www.spiritheart.org/forms/donation_formmail.htm

    which is setup for using fmbadhandler.php, and I purposely make the two email fields in the form NOT match to generate an error [I have set the condition <input type="hidden" name="required" value="email=email2"> and these are the only two fields which badhandler will be dealing with because I use FP extensions to handle all other possible errors in the form] I get the following message as badhandler.php tries to access the error.htm HTML Template:

    Cannot open template 'http://www.spiritheart.org/fm_templates/error.htm': failed to open stream: no suitable wrapper could be found

    Do you have any ideas as to why this is happening?

  4. #4
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: HTML Template for error handling

    Hi,

    Are you using TEMPLATEDIR or TEMPLATEURL for accessing the templates?
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: HTML Template for error handling

    Hi,

    I just checked your form.

    You have:
    Code:
    <input type="hidden" name="bad_template" value="http://www.spiritheart.org/fm_templates/error.htm" />
    This is not correct. You specify the path to the template in TEMPLATEDIR or TEMPLATEURL and then you just specify the name of the template in bad_template:
    Code:
    <input type="hidden" name="bad_template" value="error.htm" />
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  6. #6
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    I had just changed it to the full url for a moment to see if it would make a difference, it didn't. You caught it during those few moments. It is back set at <input type="hidden" name="bad_template" value="error.htm" /> again, this still generates the error.

    I am using TEMPLATEDIR.

  7. #7
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: HTML Template for error handling

    Hi,

    If you need the FrontPage extensions to process this (I'm not exactly sure whether you do), then you'll need to use TEMPLATEURL (so that it gets processed through the webserver).

    If you're using TEMPLATEDIR, what's the exact error message you get?

    The likely cause is that you don't have the path name (a directory path, not a URL) correct to the directory containing the template.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  8. #8
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    Yes, we do need the FP extensions for the form and the website, and they have not caused problems with the operations of the formmail.php so I assumed they would not with badhandler either. I will try the TEMPLATEURL method and see what happens.

    The error message itself tells me that the path is correct:

    >>Cannot open template 'http://www.spiritheart.org/fm_templates/error.htm': failed to open stream: no suitable wrapper could be found<<

    I can use the url generated in the error message to access the html template through a browser, so nothing wrong there.

  9. #9
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    OK, I tried the TEMPLATEURL method, removing the configurations for TEMPLATEDIR so they are empty strings. I get basically the same error message except now it has the user agent info in it:

    Cannot open template 'http://www.spiritheart.org/fm_templates/error.htm?USER_AGENT=Mozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+NT+5.1%3B+.NET+CLR+1.1.4322%29': failed to open stream: no suitable wrapper could be found

    Any more ideas? I would really like to be able use the badhandler feature if at all possible.

  10. #10
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: HTML Template for error handling

    Hi,

    This indicates that your server is not allowing PHP to open URLs.

    You either need to use the TEMPLATEDIR method (with a directory path, not a URL) or contact your hosting company to get them to fix their server limitations.
    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. Advanced Error Handling
    By russellr in forum HOWTO Guides and Tips
    Replies: 12
    Last Post: 26-Oct-2005, 11:38 PM
  2. html output error and parse errors in php
    By dynamicmedia in forum FormMail Subscription Support
    Replies: 8
    Last Post: 01-Dec-2004, 09:49 PM
  3. Problem with HTML template
    By bmollon in forum FormMail Subscription Support
    Replies: 4
    Last Post: 25-Nov-2004, 11:46 PM
  4. External CSS Formatting of HTML Email Template
    By sebestyen in forum FormMail Subscription Support
    Replies: 2
    Last Post: 14-Oct-2004, 10:30 PM
  5. Error template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-May-2004, 04:38 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