I have a form on my website that takes what a user inputs and queries MySQL. Is it best to have the form validation on another page of my site, where I would need to use $_POST to get the inputted info? Or should I be using a function on the same page as the form itself? Or a function on another page? I just want to the best/safest/fastest way this should be done.
For the best/safest/fastest way validating you form you can use javascript on the same page. This will reduce error when you submitting data to insert to your database.
There are plenty of javascript validation codes around the net. You can search it.
Yeah, but not all browsers have javascript enabled for some reason or another. You should always have a back up for when the user has javascript turned off.