0

Hey guys..... I have a page template I have made up & I also was POST'ing to it to process the form.... originally it was working fine, but I moved around some code & now it's not working for some reason. It just redirects to a 404 page for some reason??

Not sure if it matters but here is the code from the template file..

/*
Template Name: Detailed Quote
*/

// Make paths up

include(ABSPATH . '/includes/dq-config.php');
include(ABSPATH . '/includes/functions.php');
include(ABSPATH . '/includes/classes/class.detailedQuote.php');

// Instantiate new detailedQuote class
$quote = new detailedQuote();

if (isset($_POST['process'])) {

    // Prepare post data
    $data = $quote->prepare_quote_data($_POST);

    try {
        // Error check submission
        $quote->error_check_quote($data);
    } catch (Exception $e) {
        // Display output with error message
        $quote->displayOutput($e->getMessage());
        return false;
    }

} else {

    // Display page output
    $quote->displayOutput();

}

Thanks a lot!

1
  • whats your form like?
    – Bainternet
    Mar 16 '11 at 0:13
2

WordPress listens to both $_GET and $_POST when parsing a request. If your form input names are conflicting with native query parameters, you'll send WordPress on a wild goose chase (and most likely end up with a 404).

For your leisure, I've kindly listed them here - if any one of your form inputs uses these for a name, that's the troublemaker.

Array
(
    [0] => m
    [1] => p
    [2] => posts
    [3] => w
    [4] => cat
    [5] => withcomments
    [6] => withoutcomments
    [7] => s
    [8] => search
    [9] => exact
    [10] => sentence
    [11] => debug
    [12] => calendar
    [13] => page
    [14] => paged
    [15] => more
    [16] => tb
    [17] => pb
    [18] => author
    [19] => order
    [20] => orderby
    [21] => year
    [22] => monthnum
    [23] => day
    [24] => hour
    [25] => minute
    [26] => second
    [27] => name
    [28] => category_name
    [29] => tag
    [30] => feed
    [31] => author_name
    [32] => static
    [33] => pagename
    [34] => page_id
    [35] => error
    [36] => comments_popup
    [37] => attachment
    [38] => attachment_id
    [39] => subpost
    [40] => subpost_id
    [41] => preview
    [42] => robots
    [43] => taxonomy
    [44] => term
    [45] => cpage
    [46] => post_type
)
1
  • Thank you very much! I had the 'name' field in there & it only presented a problem if I filled that field out; which explains why it was working before when I had that field empty.
    – Brett
    Mar 16 '11 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.