Have a look through the HOW TO guide: http://www.tectite.com/fmhowto/adverror.php
Welcome to the Tectite Forums! You can download and get support for our free PHP FormMail (form processor) and other free software.
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.
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:
When I submit a form:
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?
Are you using TEMPLATEDIR or TEMPLATEURL for accessing the templates?
I just checked your form.
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="http://www.spiritheart.org/fm_templates/error.htm" />
Code:<input type="hidden" name="bad_template" value="error.htm" />
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.
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.
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.
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.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)