View Full Version : Protecting my Source Code
01-11-2004, 12:16 AM
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 :)
01-11-2004, 12:34 AM
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.
01-11-2004, 12:59 AM
I just basically want to do what brothercake did
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?
01-11-2004, 02:10 AM
? 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.
01-11-2004, 02:53 AM
but you cant get the code for the menu... can you?
01-11-2004, 03:35 AM
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.
01-11-2004, 04:18 AM
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? :confused:
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.
This path above is physically on the web server which isn't accessible to the web page viewer.
01-11-2004, 04:38 AM
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 referencedThis 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 itIf 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.
01-11-2004, 04:41 AM
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.
01-11-2004, 04:47 AM
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?
01-11-2004, 04:56 AM
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.
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).....
01-11-2004, 05:07 AM
but the human client can notYes, 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 serverThe same way they would access anything else on the Web.
...that he doesn't even have the path toThe 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.
01-11-2004, 05:27 AM
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.
01-11-2004, 05:52 AM
01-11-2004, 06:45 AM
I don't see how my answer was cockyI 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 knowIt 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 itThough 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
01-11-2004, 06:49 AM
Jeff - wouldn't such a poll be heavily biased because those voting will be the ones that evidently like it well enough to remain here, as regulars?
01-11-2004, 07:04 AM
I suppose then if you really wanted to see how useful people find it (based on how many remain) you'd have to analyze the site's stats (if the needed information exists). Such as the number of total registered users, and the percentage of those that remain active. Not perfectly accurate, but possibly good enough to get an idea.
01-11-2004, 07:28 AM
jujuraf- As a hack programmer here, I can say that I find this forum extremely useful. I've also found that the thread replies differ from person to person. JAVAEOC is a regular here as well as liorean and COBOLdinosaur, so I can see why their replies were much more frank and what you percieved as "cocky." So relax and if you disagree with the discussions taking place I suggest you spend more constructive time on the forum you prefer and not waste your time here.
So, JAVAOEC, to see brothercake's source code, use "view source" on your browser and you'll see
I hope this helps...
01-11-2004, 07:40 AM
Originally posted by Jeff Mott
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
I certainly do. If the users did not find it useful presumably they would not be users.
Wow, cool it juj...something. The only reason some of the replies come across as impatient is because this question has been asked hundreds of times on these forums. Anybody that would take 5 seconds and search the forums for their question before asking it would save so much time on everybody's part. We even have this thread stickied in the HTML forum or wherever.
Alright? And don't diss our community like that, I'm a member of well over a dozen forums of this sort, and this one is heads and shoulders above the rest beyond a shadow of a doubt.
01-11-2004, 12:25 PM
jkd, I DID search the forum and none of the posts answerd my question.
All of you have said that it is somehow posible to get the source code.
Fine, it is. The attached folder contains all the files. Custom.js, Menu.js... it has everything.
Yea I just copied the menu (cool), STOP - wait - but why is nothing showing up when i open the new file? Source code is prity good protected in my opinion.
so if anyone know why that is and how that is done please tell me.
01-11-2004, 12:35 PM
sorry the attachment didnt work the first time :(
01-11-2004, 02:23 PM
It's simple enough...
At first I couldn't get what you were carrying on about but now I do... And to give some credit to you, you are partly right...
The code may seem protected in the sense that since you just copied the files from his website, attempted to get them to work on your personal computer and you find that you don't get a menu...
Tis easy enough to accomplish...
Now once you have accomplised that, open the zipped archive that you downloaded, copy the custom_msdn.js and msdn.gif files that you previously downloaded to the new resources directory... After that change the template.html file so that this line:
The main purpose here is to show you two things... First, no matter how hard you try, any code can be viewed... Now don't confuse viewed as saying used... The useablity of a piece of code can be depended upon many things from it's environmental dependancies to it's progmatic validations which are in place as a protection measure... The second thing is to show that even though the code may seem unusable, it can still be viewed for learning... As pointed out by JKD, we see these types of questions all the time... You cannot truly protect your source code... As you'll notice, Brothercake did not protect the source, just the output of the source... ;)
01-11-2004, 05:02 PM
I didn't bother trying to discuss anything with juju..whatever, because I learned a long time ago that it is not possible to to communicate with a rock laying in the warm sun, and unaware that there is any universe beyond.