Results 1 to 4 of 4

Thread: badhandler.php is resulting in a 404 error page

  1. #1
    Join Date
    Jun 2008

    Question badhandler.php is resulting in a 404 error page

    Hi Russell,
    I am experiencing a server issue (I think).
    Instead of being shown my error.htm with the errors, I am being re-directed to a 404 error page.

    Previous to some changes that I have made (listed below) I experienced the following
    (may not be relevant anymore due to my changes but thought I would include info for you if it helps):

    In the past I had similar results by being shown a
    403 Forbidden page with this message:

    You don't have permission to access /fm/fmbadhandler.php on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    I have made some changes since then so I don't see the above message any more.

    The changes I have made were:
    changing the index page for my site to a Wordpress blog.
    I revised the $TEMPLATEDIR and $TARGET_URLS values on the php files.

    The page that you will see now when submitting the form with errors is my blog as this is set up as the index page for my site.
    It will then re-direct to a 404 error page.

    This is the 404 error page url that I get in the browser address bar:
    (Please excuse the length on all urls that I paste in this post.
    I have configured define("PUT_DATA_IN_URL",true); to false as the error results were showing in the urls.)

    This is the url displayed on the 404 error page that could not be found (results from badhandler):

    I also tried experimenting with $SESSION_NAME =""
    by changing it to: $SESSION_NAME = "formerror01"; in formail.php,verifyimg.php and fmbadhandler.php

    I then get this result as the url displayed on the 404 error page that could not be found:

    I have left the $SESSION_NAME value in each of the php files as described above for the time being in case it is necessary. If not then maybe it should be returned to the default value?

    You mentioned during a short conversation on the phone to me that there are some people that can have question after question that can go on for a few weeks.
    I could be one of those people but I am hoping that I will be able to resolve them on my own once the initial problem is sorted out.
    I do have some additional questions for you which I will list here just in case you are able to answer them for me quickly. If not then
    maybe I can address them with a future support subscription.

    Because I will be servicing 2 different email addresses with forms I will be placing two different versions of formmail.php - is this likely to cause problems with more than one version in the same folder?
    I will also need to run two different versions of badhandler. Can I rename each version and run both scripts from the same folder (main directory - public_html). ie: badhandler1.php & badhandler2.php

    When I use badhandler - if the user's input into the imgverify field doesn't match the characters in the vimg: will the default error message appear to the user on my bad_template (error.htm)?
    If so, do I need to insert a 'special' html error tag into my error.htm for badhandler to insert the error message?

    If I use $REQUIRE_CAPTCHA = "Please enter the image characters"; instead of <input type="hidden" name="required" value="imgverify:"Please enter the image characters": where will the message be placed on my error.htm if I am using the tags: <fmerroritem1 /> <fmerroritem2 /> etc...?

    Thanks in advance.

    I will upload the following files:
    formail.php (mamog.php), fmbadhandler.php, and I can email phpinfo.pdf (host info) as the file size is 142 kb (zipped) 151 kb (pdf)

    The contact form is found at:
    and is located at: public_html folder/

    fmbadhandler.php is located at: public_html folder/

    formail.php (re-named as: mamog.php) is located at: public_html/

    error.htm (re-named as: Go_back_and_check_your_form.htm) is located at:

    The domain ( is listed as an 'addon domain' in CPanel.
    Last edited by russellr; 22-Sep-2009 at 10:28 PM. Reason: Removed attachments for user's security.

  2. #2
    Join Date
    Dec 2003

    Default Re: badhandler.php is resulting in a 404 error page


    OK, we'll deal with one problem at a time.

    I think the 404 error is because your server has a security feature that blocks any URLs that contain URLs.

    So, when FormMail redirects to FMBadHandler it includes a "this_form" parameter which specifies the original form's URL.

    Due to security bugs in other scripts, some servers are implementing a mechanism to detect URLs within URLs, and, so that's why it isn't working.

    I'll get back to you with a solution for this shortly.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder

  3. #3
    Join Date
    Dec 2003

    Default Re: badhandler.php is resulting in a 404 error page


    OK, I've resolved the first problem - required changes to FormMail and FMBadHandler to overcome the problem caused by your server's security.

    I've also resolved several other problems, and I've emailed you directly with the details.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder

  4. #4
    Join Date
    Jun 2008

    Talking Thanks for all your help!

    Thanks for all your help with my problems Russell.
    I found your service to be exceptional beyond all of my expectations.
    I am used to dealing with impersonal support from other online services that would often take me around in circles because the support staff couldn't seem to understand simple questions!
    I found you to be both professional and efficient.
    To all who read this if you suffer similar problems that I have mentioned in the above thread, then don't lose hope...
    Russell has found a work around for a recent security measure that some web servers have implemented to negate bugs with other scripts. (not Tectite scripts!)
    As far as I know he will be including the solution in a later version of formail.
    Until this time that the next version will become available, I highly recommend that you subscribe to the support forum to enlist Russell's help.
    Thanks again Russell !!
    Last edited by Frypantofire; 27-Sep-2009 at 09:39 AM. Reason: Close thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Return All Variables To Form Page On Error
    By cornernote in forum FormMail Subscription Support
    Replies: 12
    Last Post: 31-Oct-2004, 10:20 PM
  2. Return All Variables To Bad_Form Page On Error
    By vladimir in forum FormMail Subscription Support
    Replies: 2
    Last Post: 07-Jun-2004, 06:13 PM
  3. Error Messsage for Formmail.php
    By dparker2 in forum FormMail Subscription Support
    Replies: 8
    Last Post: 01-Jun-2004, 08:09 AM
  4. No return link for badhandler
    By ptr in forum FormMail Subscription Support
    Replies: 3
    Last Post: 27-May-2004, 12:27 AM
  5. scrip of error page
    By frans47 in forum FormMail Subscription Support
    Replies: 4
    Last Post: 19-May-2004, 04:08 AM


Posting Permissions

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