Is there a way to block external acces to a .php file (like in the URL) and allow if the .php file got called by jquery post?
Thanks!
Wouter0100
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume because you say
like in the URLyou want to preventGETrequests.You can put this at the top of your script to prevent people accessing it through the URL. You will then only be able to
POSTto it, such as jQuery POST.Be aware, other sources can still
POSTto the form as well. This method only prevents access through other methods such asGETrequests. I.e. typing in the URL in the address bar.