On each example of form processing I found this scenario:
if(!empty($_POST)) {...
… and than – so many lines (sometimes about 250) which belongs to the above if.
Very unsuitable to track.
Is there a way like this:
if(empty($_POST)) {show show some message or echo… anything}, and then – stop the code
So all next lines will be outside of very long if and they’ll still execute only if that if is satisfied.
I tried something, but the members of $_POST (username, pass…) in this case are not available.
Define a function that will execute the code necessary and pass the $_POST variable as an argument. In that way the required variables (e.g. username, password) are now available in the function
You call the function after you checked the post