Say i have a basic html page where a simple form is set up. When the user submits the form I would like a php script that is stored out of the www folder (for security reasons) but on the same server to then validate that none of the form's fields have been left empty. This data could then be sent to a server to be stored in a database.
My question is how would I actually access the php script as it is out of the root directory? I know about get and post requests but I don't know how I could point to the file out of the root folder securely. This is because the user could look at the onsubmit function in the html file and find out the location of the php file and the download it. Is that possible? I am not even sure with that...
I have done a bit of searching around and am sure this question is answered but with my basic knowledge of PHP couldn't wrap my head around it. Could anyone please post a simple answer. It would be much appreciated.
Aucun commentaire:
Enregistrer un commentaire