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

Thread: Bad_URL?

  1. #1
    Join Date
    Apr 2004
    Posts
    13

    Question Bad_URL?

    I have downloaded formmail.php and configured the value for the TARGET_EMAIL field. I then designing a simple HTML form (2 fields) in order to get myself familiar with the product. I seem to have one small problem though. In testing my form I have found that after I fill out the form and click the Submit button it redirects me to the page for the value assigned to the hidden field bad_url. The results of the form are emailed to me as I would expect it to but, for some strange reason it goes to the bad_url and not the good_url. Any help you can give would be greatly appreciated.

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

    Default Re: Bad_URL?

    Are you sure the email you're getting doesn't have an error report in it?

    If the browser is redirected to the bad_url, then it's likely you have an alert message being sent to you too (if you have DEF_ALERT set in formmail.php or alert_to set in the form).
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Apr 2004
    Posts
    13

    Question Re: Bad_URL?

    Does the value you put in the field TARGET_EMAIL govern the alert_to field as well? If so then that probably explains why I was not getting the alert message. I changed the value for TARGET_EMAIL and now I'm getting both an alert message and the email itself. I also am still being redirected to the bad_url page. Where do I go from here?
    Last edited by msoucy; 19-Apr-2004 at 01:43 PM.

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

    Default Re: Bad_URL?

    Yes, with every email that FormMail sends, the recipient's address must first get through the TARGET_EMAIL test.

    So, alert_to and DEF_ALERT must be included in the TARGET_EMAIL too.

    The next step is to examine the message you're getting in the alert and fix the problem it's reporting.

    (PS It's late here, so I'll be signing off in a few minutes.....if you respond quickly, I'll hang around a bit longer.)
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Apr 2004
    Posts
    13

    Question Re: Bad_URL?

    The message I'm getting in the alert email is:

    This error occurred in the script: mail_failed
    **********
    Error=Failed to send email

    I find that a little weird because I'm getting the email itself as well. I'm a little confused. Thanks for all your help!

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

    Default Re: Bad_URL?

    That does sound weird.

    The "mail_failed" error does mean that PHP in your web server has reported a failure in the underlying call to "mail".

    First, you need to clearly distinguish between an email you receive as an alert and the email you'll get when FormMail succeeds. They both look similar, but the alert mail has an error message and the normal mail doesn't.

    If you're getting the alert mail only, then I would suspect that it's the normal email that's failing. If you're getting both mails, then it seems you might have a problem with your web server or PHP's configuration on your web server.

    The cause could be that the email addresses you've specified are not valid in some way (these are the addresses you've specified in recipients in the form).

    You can use the test script in this post:
    http://www.tectite.com/vbforums/show...?p=217#post217
    to test the email addresses you're trying to send to as well as test your web server.

    If that test PHP script works OK, FormMail should too.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  7. #7
    Join Date
    Apr 2004
    Posts
    13

    Question Re: Bad_URL?

    I tried the testmail.php script as you suggested and I get the same results. The testmail.php script reports that "Mail function FAILED" but, I get the test email like it did work. This is really weird! Do I need to contact the System Administrator for the web server that is hosthing my web site and involve him with my problem?
    Last edited by msoucy; 19-Apr-2004 at 08:36 PM.

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

    Default Re: Bad_URL?

    Yes, it is strange.

    I would recommend that you contact your System Admin. The testmail.php is so short and simple that it will make it easy to prove to them there is something wrong with the server.

    Simply ask them why PHP mail is reporting failure on their system and point them to the testmail.php script.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  9. #9
    Join Date
    Apr 2004
    Posts
    13

    Question Re: Bad_URL?

    I've contacted the system administrator for the company that is hosting my website. I sent him a copy of the testmail.php script and he tried it and it failed for him as well. I think we are both baffled! I sent him a link to your web site in case he had any questions of his own. Is there anything else you can think of? Should I run the phpinfo script? Is there anything in particular I should look for? I suppose if worse came to worse I could make the bad_url page to be the same as the good_url page but, it would defeat the purpose of the user being notified if there was a problem, and every time the form was filled out I would get the alert email as well. This is really bugging me, and It's getting to a point now where I just want the problem solved. I really like your product, and I want to use it. It's really well documented and the best form mail script I've see so far!

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

    Default Re: Bad_URL?

    Hi,

    Since you're actually getting the email, even though your server reports an error, you can change the following line in formmail.php (approx line 1416):

    PHP Code:
       Error("mail_failed","Failed to send email"); 
    to
    PHP Code:
       // Error("mail_failed","Failed to send email"); 
    That is, put a semicolon, to make an empty statement, then add two slashes to make the rest of the line a comment.
    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. bad_url not working if detectattacks is true
    By mstewart14 in forum Community Support
    Replies: 3
    Last Post: 16-May-2012, 04:54 PM
  2. good_url always works, bad_url doesn't for one form
    By jwig in forum Community Support
    Replies: 6
    Last Post: 25-Jan-2008, 05:02 AM
  3. bad_url template?
    By nickg21 in forum Community Support
    Replies: 1
    Last Post: 09-Jan-2007, 05:11 PM
  4. good_url, bad_url issues
    By mcameron in forum Community Support
    Replies: 1
    Last Post: 04-Dec-2006, 10:08 PM
  5. bad_url and badly formed 'email' field
    By tsrwebman in forum Community Support
    Replies: 2
    Last Post: 06-Nov-2006, 04:34 PM

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