WordPress.org

Ready to get started?Download WordPress

Forums

TDOMF: SUBMITTED BAD DATA on posting (20 posts)

  1. jybanez
    Member
    Posted 6 years ago #

    Hi,

    I installed TDO-mini-forms and everything was ok until when i a post is submitted, "TDOMF: SUBMITTED BAD DATA" is displayed.

    Please help.

  2. the_dead_one
    Member
    Posted 6 years ago #

    Hmm. That is very strange. That should only happen if your are not submitting from a form created by TDOMF...

    Or maybe your theme doesn't have the right hooks...

    Could you try submitting from the "Your Submissions" page? (If your logged in as an admin, it's under the User menu).

  3. JaneLitte
    Member
    Posted 6 years ago #

    I am getting the same problem. I can submit when registered but unregistered users cannot.

  4. the_dead_one
    Member
    Posted 6 years ago #

    Hi JaneLitte, when you say "unregistered users cannot", do you mean that if you log out and try to submit you get "TDOMF: SUBMITTED BAD DATA"?

    If that's the case, I suggest when you log out and then reload the page with the form. A new key is generated on each page (re)load and is only valid for one form submit. So if you submit a form logged in, then log out and try to submit from the same form, you'll end up re-using a key that has already been used and you'll get "TDOMF: Submitted Bad Data".

  5. JaneLitte
    Member
    Posted 6 years ago #

    No, unfortunately, if I log out and reload and try to submit, I get the TDOMF:Submitted Bad Data

    Link here

  6. joand
    Member
    Posted 6 years ago #

    That happened to me. Well I don't actually remember if it was this form or not - but the problem was that I am using an "all in one" theme i.e. it does not call a separate header file. The solution was to add <?php session_start(); ?> to the very top of my page.php template and then it worked fine.

  7. the_dead_one
    Member
    Posted 6 years ago #

    Yes, joand's solution is good, but I've added more error messages in v0.9.1 to make it easier to track down the problem. Essentially, you should not be seeing "TDOMF: Submitted Bad Data" alone, there should be other errors displayed and listed in the log.

    JaneLitte, I suggest two things to try. One, disable all your plugins except for TDOMF. Repeat your test. If it continues to fail, then try changing your theme to the default WordPress theme.

    If it's your theme, then check to see if it uses "get_header" template tag. If it doesn't, then you'll need to insert session_start at the top of your page.php file as Joand suggested. If it does use get_header, check to make sure nothing else is printed out before get_header. Even a blank line is bad news.

  8. the_dead_one
    Member
    Posted 6 years ago #

    BTW, is this really on WordPress 2.2.2? I've never tested it on 2.2.2, only 2.3.

    Also check out the FAQ which covers these errors.

  9. kubuntuguide
    Member
    Posted 6 years ago #

    thanks Mark for getting back to me on this so quick. here is everything I have done:

  10. disabled all other plugins and tested it (no luck).
  11. used the default WP theme and it works!
  12. for my custom theme my page.php already has <?php get_header(); ?>
  13. I added <?php session_start(); ?> to the top of page.php, but I still get the error: TDOMF: Bad data submitted. Please return to the previous page and reload it. Then try submitting your post again.

    Any further assistance will be highly appreciated.

  • the_dead_one
    Member
    Posted 6 years ago #

    The fact that your default WP them works, points to something being wrong with your theme. What does it say in the log? Is the form on a page? What theme are you using?

  • the_dead_one
    Member
    Posted 6 years ago #

    How bizarre! Why is my post at the top of the page? (and this one too!)

  • kubuntuguide
    Member
    Posted 6 years ago #

    i have managed to figure it out that the culprit is the header.php file since replacing it with the same file from another theme seems to make it work.

    i have tried adding in <?php session_start(); ?> and <?php get_header(); ?> individually as well as both at the same time, with any of those in the header.php file (at the top) the behaviour of the page changes when submitting.

    Instead of the error I get a frozen page now.

    Here is the code from the header.php:

    http://www.kubuntuguide.com/wp-content/themes/kubuntutheme/header.txt

  • kubuntuguide
    Member
    Posted 6 years ago #

    ok adding <?php get_header(); session_start();?> to the top of page.php and also adding <?php session_start(); ?> to the top of header.php made it work for me!

    Awsome work Mark, by contributing this amazing plugin to the community!

  • the_dead_one
    Member
    Posted 6 years ago #

    Brilliant! I'm glad it works for you now kubuntuguide!

  • Hogancom
    Member
    Posted 6 years ago #

    I am getting the "TDOMF: SUBMITTED BAD DATA" .

    my log says:
    [24.8.215.9][08-02-08(16:41:14)] Form submitted with bad key (session = , post = cb35933) from 24.8.215.9 !
    [24.8.215.9][08-02-08(16:41:19)] Placing key a49e9ff in $_SESSION:
    array (
    'tdomf_key' => 'a49e9ff',

    I did what it says in the post.

    "<?php get_header(); session_start();?> to the top of page.php and also adding <?php session_start(); ?> to the top of header.php"

    But I still got the resulting log error.

    Any ideas? I need "name" "validating email" and comments.

  • the_dead_one
    Member
    Posted 6 years ago #

    What version are you using of tdo-mini-forms? The last few releases do not require you to modify your theme. It should simply work.

  • tgiokdi
    Member
    Posted 6 years ago #

    I've found that if I have any caching plugins that TDOMF fails on a fairly regular basis, depending on when the page was last cached. I'm using WP-super cache, and if it's ever enabled, TDOMF gives the same "bad data" error

  • the_dead_one
    Member
    Posted 6 years ago #

    Oh dear. Yes of course TDOMF will fail if you cache the page the form was created on. When the form is created, it generates a key that it sticks in the session. When the form is used, the backend checks against the key and if they don't match, it'll report "BAD DATA".

    Caching the page that holds the form means that the key in the form holds the key used when the page was cached. So the keys won't match.

    The only solution is to exclude the page the form is on from being cached or you use the form in the "Your Submissions" page that appears when you log in.

    I'll add info to the readme about it.

  • Hogancom
    Member
    Posted 6 years ago #

    I am using version 0.9.4 (build 19).

    I tried using the YOur Submissions page. I still got the bad data error. Here is what it said in the log.

    I'm using no caching widgets or programs.

    I cleared the cache in my computer with cCleaner.

    [admin][18-02-08(13:02:12)] Key is missing from $_SESSION: contents of $_SESSION:
    array (
    )
    [admin][18-02-08(13:02:12)] Form submitted with bad key (session = , post = f33f9) from 24.8.215.9 !
    [admin][18-02-08(13:02:16)] Placing key a94a0bdfe44d467c7bf642cb5d3fa2a in $_SESSION:
    array (
    'tdomf_key' => 'a94a0bdfe44d467c7bf642cb5d3fa2a',
    )

    the page is located at http://www.askbobwilson.com/index.php/ask-bob-a-question

  • the_dead_one
    Member
    Posted 6 years ago #

    I'm not sure what could be your problem. Could you check your phpinfo (you can do that from the main page of TDOMF). What is the setting of session.auto_start? In fact what are the settings of all your session.* variables?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags