954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

hide html code on my website

How can i hide my html code on my website? when browsing to it using IE,i can click on View source and see all my html code.
Is there anything i can install on my server to hide my site's html code?

Thanks

daabomb2002
Newbie Poster
4 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

I am not sure but i think there are some Code encrypting programs. If you can find one, i am sure you will do what you want.

jamshid
Junior Poster in Training
70 posts since Jan 2006
Reputation Points: 8
Solved Threads: 0
 

In a word; No.

HTML is delivered to users as 'source code', which the user's browser then interprets. There is nothing you can do to protect HTML code; except trying to enforce your copyright if it's stolen.

Also, you can't easily 'scramble' or obfuscate HTML code as you would with other types of code; because even subtle changes will often have some visible effects.

The best you might get, is encrypting the page, saving it somewhere on your server; and responding to requests with a blank page that runs a Javascript function to collect, decrypt and display the page content.

But, as you can't encrypt Javascript programs either, and since you'd have to send a link in the page to a program that can collect and decrypt your pages; it's gonna by like holding sand in a sieve...

Still, you might be able to do some funky business at the server to hide the Javascript code by means of checking the referer in an HTTP header... so that only your pages can link to the JavaScript code. This still has drawbacks; some browsers might let a user see post-JS source code ( and all browsers have to download the code, and most cache it somewhere ); and it's going to greatly increase the loading times for your pages; and the pages' contents will be totally indeterminable by a search engine spider.

MattEvans
Veteran Poster
Moderator
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
 

If you want to encrypt it, go to designerwiz.com.
Then go to js code makers, amd it's on the bottom of the page under security

connor4312
Newbie Poster
16 posts since Apr 2007
Reputation Points: 9
Solved Threads: 0
 

Why do you want to do this? It sounds very selfish to me.

You are not going to hide any of the other files on your site that way. There are programs which can read your web directory.

The whole purpose of the web is openness. Don't try to defeat that.

I do know ways of hiding email addresses from robots, yet leaving them visible to users.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 
Is there anything i can install on my server to hide my site's html code?

I don't sure, that there are softs, that can be installed on server and do it on fly, but you can use some dekstop softs or online tools, that do it.You are not going to hide any of the other files on your site that way.
sometimes if u are webmaster/webdesigner [in work with your clients] you need it :-) hope you understsand what i mean :-)

Lusine
Newbie Poster
8 posts since Nov 2007
Reputation Points: 12
Solved Threads: 0
 

If the file is used to render a website, it can't be hidden from the user. The browser needs the source code itself to do the rendering, and so it can always display it to the user.

There is no binary file in HTML as there is with other programming languages.

You can make some files private, but that means that nobody except you can access the files. They can't be used to render a web page on someone else's computer..

Since most HTML code is a straightforward solution to the wanted layout, there is probably no intellectual property in the source code anyway.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

If you want to HIDE proprietary code from the users, try developing the site in ASP or ASP.NET, but as MidiMagic stated, the HTML MUST be visible for the browser to interpret.

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

if you know any coding in css that would work to because all of your formating can be linked to an external style sheet that nobody knows the properties of.

twkillswitch
Newbie Poster
11 posts since Nov 2007
Reputation Points: 9
Solved Threads: 0
 

Style sheets can be downloaded though. If you look in the tags of any page on the site you can get the location of the CSS file. Once you know that all you have to do is put the path to that file in the address bar and it's yours.

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

you would have to need rights from your hosting server in order to download that style sheet.


for the href it would be a host directory i dont thnk there would be any issues that would be one of the main reasons behind having an "external" style sheet

twkillswitch
Newbie Poster
11 posts since Nov 2007
Reputation Points: 9
Solved Threads: 0
 

If the user doesn't have 'rights' to download the stylesheet then it wont affect any pages they view. if i read your , I know that 'style.css' is either in the same folder as the page, or at the very least the server will act as if it is. The browser needs to download that file in order to render the page, so if you protect the file (i.e. give it no public read access), the browser cannot download it, and thus cannot style the page. Of course, there are ways to slow down those people trying to 'steal your work', but, in general; it doesn't matter what convoluted route or server trickery you perform - if you put it on the web, and link to it ( in any way ), anyone who can see it can get it.

I never consider the protection of intellectual property as one of the main reasons for using an external stylesheet. Neither does anyone else.

MattEvans
Veteran Poster
Moderator
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
 

you would have to need rights from your hosting server in order to download that style sheet.

for the href it would be a host directory i dont thnk there would be any issues that would be one of the main reasons behind having an "external" style sheet

Lets take this forum for instance. I just right-clicked and did a "view source". From that source I quickly (I mean within 5 seconds) found this information

Now, if I were to add that href link to the current domain (i.e. http://www.daniweb.com) , I would have the css file, completely intact. I haven't found a site yet that locks up their css files. Actually, I don't think it can even be done.

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

Precisely Matt, nothing on the net is sacred.

I've always seen external style sheets as a way of providing multiple styles to a single page, or a single style to multiple pages.

They're great for blog skins or allowing your visitors to customize their version of your site, but I had never even looked at them as being a security device.

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

The CSS is downloaded too if you use the SAVE PAGE AS menu item on your browser. So is the JS.

Publishing the page while wanting to hide the code sounds like an oxymoron.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

I still do not see a reason to want to hide the source code. I know plenty of people who have mentioned wanting to do this in the past and it's just silly.

You want the user to see the way the site looks, but not be able to see how you did it? Well, any fairly decent programmer can take a look at your site and recreate the basic layout of it in less than an hour, without using your code.

There is nothing that you can do in HTML that hasn't already been done, and probability says that you most likely learned those tricks by looking at what other people have done as well.

The only reason anyone would want to "hide" their code would be that they have visible text that they just don't want people copying, and they have already dissabled the copying of the text on the site. Again, anyone can just type that stuff out anyway. Besides, if you are going to be providing information to people, you should allow them to copy it to their hard drive so that they can reference it later.

I get urked by snopes.com because you can't copy their text, and the people that send me the emails that I look up are blocked from snopes at work.

If you are disabling right click all together, you will drive people away (I don't visit any sites with right click disabled).

The web is all about the user finding information and being able to use it.

That said, there are a few things that you can do to keep your proprietary stuff less available.

Use Java applets (not scripts, applets), use Flash, or burry everything amoung a mirriad of framess.
Sage

sagedavis
Junior Poster in Training
86 posts since Nov 2007
Reputation Points: 10
Solved Threads: 6
 

A couple points for you sage,

You want the user to see the way the site looks, but not be able to see how you did it? Well, any fairly decent programmer can take a look at your site and recreate the basic layout of it in less than an hour, without using your code.

Any fairly decent programmer wouldn't need to steal code, they would be able to produce it themselves without even having to think about how it should be done.There is nothing that you can do in HTML that hasn't already been done, and probability says that you most likely learned those tricks by looking at what other people have done as well.

That's why faster and better languages are constantly being developed. Developers are titled that for a reason, theydevelop code which outputs greater amounts of HTML in shorter amounts of time. HTML is only the visual that we all see, which will soon be replaced by XML because it's even faster.

The only reason anyone would want to "hide" their code would be that they have visible text that they just don't want people copying, and they have already dissabled the copying of the text on the site. Again, anyone can just type that stuff out anyway. Besides, if you are going to be providing information to people, you should allow them to copy it to their hard drive so that they can reference it later.

I agree that people should be able to have access to the content of any page. Once it is put on the internet it is pretty much public domain anyways. If someone wants something they're going to take it. But, there is a BIG difference in the content I provide my readers and the code I use to present that content. If I didn't want my readers to know something, I wouldn't create the page that gives them that information. The point is HOW I give them that information. The code was created by me and is my code, nobody has a right to it but me.Use Java applets (not scripts, applets), use Flash, or burry everything amoung a mirriad of framess.

I'm not too familiar with applets, but I understand they're more resource intensive than scripts, is that correct?

I've often thought about diving into Flash, but haven't found the need for it yet. That is definitely a way to prevent your info from being plagiarized.

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

Most likely can be sone with asp or php

cjm712
Newbie Poster
6 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

There are some javascripts out there to be had that actually do this. You simply place a snipet of code in the body of your page, and you cannot right-click on the page and "view source". There has to be something out there that would do the same for the "View/Source" on the menus.

dtaylor
Newbie Poster
1 post since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

I use similar code for my "Trusted" image (only because I want to minimize the chance of the image itself being stolen), but you can still access the Source of the page without right-clicking.

View > Source works in IE7

CertGuard
Light Poster
48 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You