Support » Plugins » Hacks » No data in $_POST

  • Hello,

    I’m writing a front-end function where a user fills in a form. But for some mysterious reason it doesn’t send any data through $_POST.

    This is my material:
    – I have two WordPress running at one server with two different accounts.
    – Account_A has the latest 3.6.1 WP version and my script works great.
    – Account_B was outdated, I just updated it to 3.6.1 but my script doens’t work.

    Account_B is the client’s website. Thats why I scripted it first at Account_A and made it work there. There are several plugins running at Account_B (ACF/Gravityforms/Members/Wordpress SEO Yoast) and there are 0 plugins (besides my own I’m creating right now) running at Account_A

    The code:

    <form action="<?php echo $siteurl; ?>/dictee/" method="post">
                        <input name="voornaam" />
                        <input name="achternaam" />
                        <input name="emailadres" />
                        <input type="submit" value="Ga verder" />

    PHP code (on top of the template file):

    if($_SERVER['REQUEST_METHOD'] == 'POST') {
    				$voornaam = $_POST['voornaam'];
    				$achternaam = $_POST['achternaam'];
    				$emailadres = $_POST['emailadres'];

    Resuls are empty.
    Now when I create this plugin without WordPress (so basicly run it at the root with pluginnaam.php) It works great. But once it makes use of the “rewriting” it fails to parse any data.

    The weirdest thing is, on installation A it works fine the way it should. But installation B fails at parsing the data.

    Does anybody have any idea wich or what can be bugging with installation B?

    My “thoughts” are that the problem goes with the rewriting, since a stand alone version works fine (meaning the server should not be the problem). On the other hand, Installation A works great with the same rewriting.

Viewing 1 replies (of 1 total)
  • The rewriting should not be a problem. A redirect on the otherhand would be, according to the RFC 2616.

    First I would check if your site is being redirected (maby by one of the plugins).

    If that’s the case either using GET instead of POST might do the trick. I haven’t tested it but as I understand some browsers will turn POST data into GET data when doing a redirect?!

Viewing 1 replies (of 1 total)
  • The topic ‘No data in $_POST’ is closed to new replies.