...

View Full Version : Hiding multiple javascript files with php



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

http://www.developertutorials.com/tutorials/php/hide-your-javascript-with-php-050419/page1.html

How is it possible to use it for other javascripts?

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

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

Fumigator
03-23-2007, 08: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.

Errica
03-23-2007, 10: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.

firepages
03-23-2007, 11:32 PM
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 ;)

Fumigator
03-23-2007, 11:42 PM
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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum