I am trying to stop direct access to a subdirectories and the php files within subdirectories. I\'ve added the following code below to the .htaccess file within the subdirec
I would put apache directives aside, and -perhaps- focus on a php-based solution:
Make sure your file containing the jquery ajax call has a ".php" extension.
(of course inside that file, all jquery must be contained within and tags.
Inside your jquery function just before the ajax call, type that:
(php tags run even if they are contained in "script" tags)
Open your ajax (php) file and at the very top type this:
... and you are Done!
P.S. Naturally, you may (or better: should) rename the sessions and give them different or more complex values, but I was just trying to point out the basic idea... Happy coding!