After many attempts of writing a code that can sanatize/validate $_POST["input"] in a PHP form I have to ask about it in general, because every attempt didn't work as I expected. I really have tried much and i just started to exercise with coding 2 months ago (html, css, bootstrap, wordpress, php). I hope you can tell me, as you can see, what is the most common or "best" way to sanatize a php form.
I have re-writed some OOP PDO form validation, which i couldn't get runned as i integrated it into a new homepage, because my OOP skills = 0.
It was build with classes, but i didn't see any prepared statement, which surprised me because prepared statements are idolized in the web.
Which is the better way and could you tell me why?
I hope you can answer my question and explain a little bit how i can handle it in a "pro-way", which in the best case is safe, because it is a hurdle for me.
Thank you for your help.