Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding Code and Restricting Visitor Functions

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
US
Saw that thread and was going to reply, but decided to just create a tip.

I've used the following method to give the appearance that code is hidden. It fooled me at first and I've seen this method used on a few other sites.

On the first line of HTML, you can put the following.

<!-- HTML Source Hide V1.5 -->

Or something else that gives the appearance that your source code is hidden.

The just place about 300 or so blank lines before you're actual HTML begins. When someone clicks View / Source, all they see is that first line. It can be convincing since most people are used to seeing all of the code at the top of the screen. Sounds sort of ridiculous, but it's better than nothing..

If you run your web page on a server with SSL and can get or force your users to accept a security certificate, you can do many things that will restrict navigation, etc... But you have to get them to accept your certificate first. Most people don't realize that accepting a security certificate or accepting trust can give the programmer extensive access to their system.

Without the certificate, you can still do some restriction. Although you cannot change the state of the current window without the users permission, you can always open a new window and set the properties to not have a title bar, address line, icon bar, etc... Of course, right clicking on the web page brings up a menu that allows back, forward, refresh, etc... Another neat trick is to use the location.replace(&quot;mywebpage.htm&quot;) to navigate your website. For example:

Code:
<a href='javascript:location.replace(&quot;mywebpage&quot;)'>Link</a>

When you use this function, the linked page replaces the current page in history. Try it, the back button won't work and the last page visited is erased from history.

ToddWW
 
WHY BOTHER?!?! Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top