Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Clear Input::post after submit
  • Hello everyone!

    How could I clear the Input::post's values after submit?

    Example:

    I saved the information in db and I back to the form to a new register (same form), but as the post already loaded values ​​are displayed in the fields.

    I tried to use Security::clean_input() but not work.

    I solved using $_POST['name'] = ""; or redirecting to itsself.

    Are this correct?
  • Then your code is wrong.

    It is best practice to redirect away with a 'success' messsage of some sort after processing a POST. If only to prevent people from reloading the page (which with your code will cause a second post request with the same data).

    For an example of a correct flow check this example: http://fuelphp.com/docs/packages/auth/examples/auth.html#/registration

Howdy, Stranger!

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

In this Discussion