Basically what I'm trying to do is prevent JavaScript file access by anyone.
The way I'm doing it at the moment is using this in the webpage..
Code: Select all
<script language="JavaScript" src="socket.js"></script>
..and the socket.js file contains..
Code: Select all
document.write("<script language="JavaScript" src="inc/myscript.js"></script>");
..what that does is include the myscript.js file as normal but it doesn't get cached or displayed in the page.
Now it's obvious (if people look at the files) to find the location of myscript.js... which is in the inc folder. At the moment anyone can just enter the path of the file in the browser and get access to the file, but I want to make that inc folder locked and only accessible when the website page requires files from it.
I'm thinking that if I stick a username/password on the folder then I might be able to get PHP to tell the folder the username and password when it accesses it... thus allowing access to the files by the web page and not by joe public.
Hope that makes sense
