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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Protecting my Source Code

    how can I protect my source code?

    if it is php or any thing else then js, html, or css then please give me the complete code cause I am to stupid to handle anything else

    thanks for any help

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    399
    Thanks
    2
    Thanked 30 Times in 30 Posts
    protect it from what?

    If you mean prvent someone from stealing it then:

    put it in an envelope put the envelope in a sfetedesosit box, and never under any circumstances put it on a web page.

    No one has to steal it... you give it to them ever time you let them down load a page. The code is on their computer, and they can do anything they want with it.

    You can make it more difficult, you can cripple your site by wrapping layerof nonsense around the code, but all you do is:

    A make your site less usable.
    B do a lot of extra work for nothing
    C challenge all who take code without permission
    D make yourself look silly.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just basically want to do what brothercake did

    http://www.brothercake.com/dropdown/msdn.html

    that is a style example of his cool dropdown menu and u cant get the source code...

    thats all i want to do but how?

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    ? Can't get the source code? What are you speaking about, it's not even blocking right click, not to speak of all fifty-eleven other ways to get it.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but you cant get the code for the menu... can you?

  • #6
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, you can. There are not even any petty attempts to stop you or obscure the code. It is called, quite plainly, menu.js. In fact, he even links directly to custom_msdn.js, which appears to be the foundation of the menu.

  • #7
    New to the CF scene
    Join Date
    Jan 2004
    Location
    San Jose, CA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unfortunately none of these cocky replies you've received answers your question or helped you learn anything. I thought that's what this forum was for?

    The reason why you can see the JS code on the page you listed, is because the owner provided a link to the file as a sample. This certainly is not normally done. I think what you meant to ask is how to hide/protect the code in a 'normal' HTML page from being stolen (your example was not a good one). The HTML can't be protected since it's needed to create the page, of course. The JS can be hidden by placing the code in a .js file and including it just like the HTML did on the page you referenced. This .js file is somewhere on the web server and the client machine can't access it. So if your HTML contains this, the code is hidden from the user.

    <script language="JavaScript" src="../dirName/code/myStuff.js"></script>

    This path above is physically on the web server which isn't accessible to the web page viewer.

    Deb

  • #8
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The JS can be hidden by placing the code in a .js file and including it just like the HTML did on the page you referenced
    This will not hide the code. It merely adds one additional step in retrieving it.
    This .js file is somewhere on the web server and the client machine can't access it
    If the client machine couldn't access it then the browser would not be able to execute it. In fact, the client machine accesses it every time it accesses the HTML document that imports it. And it can still be accessed directly with the URL for the script.
    Last edited by Jeff Mott; 01-11-2004 at 04:40 AM.

  • #9
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok

    on the link i showed you, you can NOT see the source code of the menu(as far as I know).

    so if you can post the WORKING menu in a zip file then i will feel stupid.

    so if there is a way to get the code for the menu please please please post the whole zip folder here.

    thanks

  • #10
    New to the CF scene
    Join Date
    Jan 2004
    Location
    San Jose, CA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well YES the client machine can access the .js file, but the human client can not. The client machine needs it to render the page and do its thing. I don't see how the client can access a file in a directory on some distant server that he doesn't even have the path to. Even if you know it's in "../dir/dir/code/blah.js" how does that help viewer of the web page?

    Wasn't that this person's question? Getting the JS code from the displayed page?

    Deb

  • #11
    New to the CF scene
    Join Date
    Jan 2004
    Location
    San Jose, CA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm confused. The owner of this page GIVES you the source code! It's right there on the link at the bottom of the page. Just click it, reply to the pop-up message to open or save it. If you save it to your computer, just open it and view it with any text editor.

    Deb

    Originally posted by JAVAEOC
    on the link i showed you, you can NOT see the source code of the menu(as far as I know).....

  • #12
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but the human client can not
    Yes, they can. All they need do is type the full URL, which would be given in the HTML source, in their address bar. OR, open their internet cache (temporary internet files) and retrieve the file from there.
    I don't see how the client can access a file in a directory on some distant server
    The same way they would access anything else on the Web.
    ...that he doesn't even have the path to
    The path is in the HTML source.
    Even if you know it's in "../dir/dir/code/blah.js" how does that help viewer of the web page?
    By telling them where the file is, which is all they need.
    The owner of this page GIVES you the source code!
    It's funny that you described liorean's and my reply as cocky, and yet you reply with nearly the same thing.

  • #13
    New to the CF scene
    Join Date
    Jan 2004
    Location
    San Jose, CA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is TOO funny! Egos are very big with most programmers and they find it hard to explain things to beginners (as if they were never one themselves). I've read many posts to questions in this forum and many of them never answer the poster's questions, rather they make some smart remark to 'prove' their superior knowledge. I don't see how my answer was cocky since I clearly explained how and why the code is visible (it's only visible because the web page owner provided a button to view it as we know). After 18 years in the software business, I'm still disappointed at the superiority complexes carried around by so many people. It's one of the main reason so many software programs are so horrid to use for the beginner computer user.

    Unfortunately this forum is like 90% of the forums out there. Little use for the folks who really need it. I have however found a fantastic forum that has great people on it, very knowledgeable who are very willing to help anyone understand and learn so many things. After being a member for 4 years I've never read any posts on that forum that come close to the things I've read here (or other places). I'm not about to tell anyone here where that forum is as I want to keep it great and useful.

    Fortunately I answered the poster's question already... just click on the link and fetch the code for yourself. If you're so satisifed with your own answers, why couldn't you just tell him that nicely?

    Don't bother flaming me back/forth with e-mails. I'm outta here, I have better things to do. If you think you're so great and all-knowing, try teaching a group of beginners.. that'll humble you right down to Earth.

  • #14
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    I would disagree with you. The code it right there, given by the url to the JavaScript files. Sure, it's not displayed at view-source, but everything he needs to know to get at it is there. He just needs to have a look at the JavaScript source files linked to the document. These can be found by looking at the source code, or using Mozilla's Venkman, or using my ViewScripts bookmarklet (see <http://liorean.web-graphics.com/>). It's not hidden in any way.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #15
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't see how my answer was cocky
    I did not mean to imply so. The point I meant to make was that liorean's and mine were not.
    it's only visible because the web page owner provided a button to view it as we know
    It would still be accessible without that link using any of the methods already described in this thread (viewing the HTML source to see the path to the script OR retrieve the script from internet cache). If you need a more detailed description or example then ask. We cannot always know the level of experience of the people we reply to and thus do not always describe things in the most specific detail.
    this forum is like 90% of the forums out there. Little use for the folks who really need it
    Though this is only my opinion and I have no real source to back it up, I believe that if you created a poll asking users if they find this site useful that you would find an overwhelming majority do


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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