Search code examples
jqueryaccessibilityblocking

Prevent .php file from being loaded outside jQuery request page


I have a page that is loaded within another page using jQuery. What I wanted to know is if it is possible to somehow block direct access to that page that gets loaded within another page.


Solution

  • You can try adding some magic value, to your get/post or cookie. Then check that value at the start of your page, and return some error page if it's missing.

    However, that will NOT prevent some user from doing exactly that. if they debug your requests, for example with Firebug, then they can replicate the request with that magic number.