Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Input post ignored?
  • It's definitively my fault....
    But for some reason the if(Input::post()) is being ignored when submitting a form

    Here is the code of my form in the template.php:

    Here is the login function:

    What am i doing wrong?
    I even tried if($_POST) and it didn't work.
  • Can't find an immediate fault in the code, so no clue at the moment. If $_POST is empty, then I would first check the rendered form.

    Can you dump Input::method() before that if? If that is not POST, perhaps you have a redirect somewhere that causes the post data to disappear?
  • The var dump is: string(4) "POST

    I'm so confused....


    EDIT:: Okay now I'm even more confused... When I write:
    Input::method() == "POST"
    then it works. I mean it's logic that it works... But its weird the other 'normal' solutions don't




  • Input::post() should return the entire $_POST array, and any non-empty array is true.

    So if you do a var_dump(Input::post()); what does it say? Haven't extended a class that broke something?
  • The array does seem empty.
    Shouldn't 'username' and 'password' be recognized?
  • Very odd. I'm clueless.

    I can't explain why $_POST would be empty on a form post. Do you have this everywhere or only in this particular example? If the method is "POST", then a redirect can't be causing this.
  • Very odd indeed.... I mean even using validations it doesnt show up anything.
    For sohttp:/me weird reason the post does work on the same host (with fuelphp) but different folder.

    I mean:
    On this url website it works: http://scripttesting.com/bassradio/users/register
    But not on this one: http://scripttesting.com/mindmapping/users/login

    I checked both htaccess's but as you say redirects can't be the issue (were the same).

    EDIT: What i do remember is that I had to disable magic quotes in the php.ini as SuPHP was installed... so I couldn't use flags anymore in my htaccess file. But the the first link wouldn't work either then if that was the issue, would it?
  • So a ittle recap: 
    1. $_POST is empty
    2. Input::method() returns "POST"
    3. 3) On the site 1 it works, changing the folder name it doesn't.
    Is it right?
  • Point 3 is kind of different:
    bassradio and mindmapping are 2 different websites with their own fuelphp core.
    The POST does work on site 1 but not on site 2.

    I didnt change the folder name.
  • omg, I'm so furious at myself right now..........

    I simply forgot to add the name value to my inputs.
    Where is my TIMEMACHINE!?
  • Ahah :-]
    Don't worry, even the best make mistakes!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion