Form validation not working

When I try to submit a form, the form comes back with the last thing filled in it, but no validation happens.

It works on my local machine but on the server it’s not. And the weird thing is it was working just a few days ago just fine. What could I check and possibly change to make this work again? I don’t get it.

Exact same code locally works just fine. But on the server it’s like it submits but then redirects back instantly without any validation done whatsoever. And when I print_r($_POST) i get an empty array.

Any help would be extremely helpful

You pointed out an impossible situation:

If $_POST is empty, from where are the data that fills the form?

There are 2 options: or you got in $_POST what you need, or your browser is not submitting at all.

If it is working locally but not on the server I think it most likely has something to do with your php.ini

Check your php.ini for the following:

  • variables_order contains ‘P’

  • post_max_size is set high enough (I don’t know which sizes you post)

  • If you are using suhosin check if is large enough

Hope that helps!

By the way: There is a cool trick that can help you to check which data the server actually gets.


try printing that out to see if the server even gets something