Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Hiding multiple javascript files with php

    I found the following and it seems to work fine with one javascript:

    http://www.developertutorials.com/tu...419/page1.html

    How is it possible to use it for other javascripts?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Same way I'd imagine, just name the Javascript files differently.

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Tried that, doesn't work.

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    It works if you do it right

    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.

  • #5
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #7
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •