Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Hide the Source

Hi Experts,
  How can I hide my source from user when they go to view source .
I came across a site where it display some rubbish characters when I go to view source .
0
seahpc
Asked:
seahpc
  • 2
  • 2
  • 2
  • +3
1 Solution
 
Answers2000Commented:
I don't think there's a way to 100% hide it as once they've got the file, you've lost control.  Even if you can do it for a particular browser, they can work round it by writing their own HTTP client (MS give away sample source for these!) or using a different browser.

You can make the source hard to read or nearly useless.
1. Use a proprietary format (e.g. MacroMedia).  That way the HTML just invokes the viewer/plug-in, and all the real content is secure (kind of).  Disadvantage:user needs the reader for the content.
2. Put all your content in Java (and don't give the source out for this).  Again HTML just invokes the Java so reading the source doesn't help the user much.  Disadvantage: user must have a Java enabled browser (lots of corporate users disable Java)
3. Remove all white space, comments etc from the source making it really tough to read.
0
 
OttaCommented:
> I came across a site where it display
> some rubbish characters when I go to view source.

Well, look in the browser's "cache" directory
on your hard-drive.  The "newest" file will be
the HTML-file which you most-recently retrieved.
0
 
1slyguyCommented:
There is no way of hiding the soure completely, just think about it, if the source could be hidden then how could your browser read the information for that specific *.HTML page?
if you come across a page which doesnt let you look at the page source, then you probably havent finished loading up the page thats all, not because the page has "hidden its source code".... also could you tellus the page ware you saw "rubbish characters"?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
seahpcAuthor Commented:
The Site which I came across is http://www.mp3software.simplenet.com/encoders.html .
Anyone who know how to create that can you please show me how or give me a simple example . Thanks
0
 
MasseyMCommented:
There is not "true" way to encode your HTML code... However, there are some tricky ways to make it harder for others to get it.

1) IF you use Javascript, place all your javascripts in a ".js" file nad then call them from your HTML pages like this:
<SCRIPT LANGUAGE="JavaScript" SRC="scripts/something.js"></SCRIPT>

This will link it to an external javascript file.  You could also put that file in a protected folder so that noone could DL it... (just use it to run the scripts)

2) Use Active Server Pages.  This method leaves all the scripting on the server and it only sends the HTML output... This is so far the best method.  

Any other question...

- Matt
0
 
kaneuaCommented:
Use ASP as your code base, this will NOT show in the source as it is run on the server. If you want to hide the HTML, well? WHY?
Is it that good? Send me a link!
0
 
seahpcAuthor Commented:
Hi MasseyM,
   Your methods will hide  the script but the HTML content will still be shown .
  I f you have went into the site I gave earlier, thats is the kind I wish to create .
 For your info, I am using ASP . Thanks
0
 
MasseyMCommented:
Their HTML is not hidden... It is much further down the page... as for the script... that is something I am currently building an app for... Also, I don't see anything on their page that even uses a script...
0
 
OttaCommented:
You've been "tricked".

The HTML at the URL which you cite begins with an HTML comment:

 <!-- @# The script is hidden  Requires password to open ! -->

and then there are about 400 "blank" lines,
and *THEN* the complete HTML for the page is available.

You just need to "scroll-down" a _LONG_ way to view the source.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now