View Full Version : Hiding multiple javascript files with php

03-23-2007, 09:30 PM
I found the following and it seems to work fine with one javascript:


How is it possible to use it for other javascripts?

03-23-2007, 09:43 PM
Same way I'd imagine, just name the Javascript files differently.

03-23-2007, 09:50 PM
Tried that, doesn't work.

03-23-2007, 09:59 PM
It works if you do it right :D

Little tip for you, when you give us "it doesn't work" then there's really nothing we can do with that. Our only answer is "OK well good luck with that then"...

Post code, explain how it didn't work, post error messages, provide a link to your test page, describe the browser behavior, post the "view page as source", etc.etc. Anything you think may help us help you.

03-23-2007, 11:03 PM
I know. I was just frustrated. :)

I need to leave work...I'll post an update this evening or tomorrow after I mess with it a bit more.

03-24-2007, 12:32 AM
if($access) should be if($_SESSION['access']) ... that's not the point though, the point is that the javascript is still downloaded to the users temp internet files so anyone can still see it & unless your javascript includes the secret to cold fusion or the meaning of life it really ain't worth the effort ;)

03-24-2007, 12:42 AM
Aye that's a good point... install the Firefox add-on Web Developer and all you have to do is "Information|View Javascript" and there it all is, whether you "hid" them with PHP or not. So a determined hax0r would find your code regardless.

On the other hand, I've seen encrypted/obfuscated Javascript code that I wouldn't even think about trying to figure out!