External JavaScript via PHP to only activate if called from a WebPage..block direct access

spoofy

Newbie
Joined
Aug 2, 2008
Messages
14
Reaction score
2
Hello,

I am trying to figure out a way where I can call an external JavaScript file which would reside inside .php file (myJavaScriptFile.js.php)

The way it would have to work is that the any webpage would call the JavaScript file so for instance index.php would be able to have the tags <script src=myJavaScriptFile.js></script> and it would do the magic wonders of the javascript file.

Now the javascript file can only work if called from my specified file, so in this case index.php. It would not allow someone else to access the file either by hotlinking from another site or directly accessing it from the url address bar.

Thanks
 
Back
Top