Version 3.1
User's Guide

Quick Start

Previous | Next
Contents

Installing NetCloak

To quickly get acquainted with NetCloak, you can install the NetCloak Introduction as described below. The Introduction includes links to sample pages which demonstrate some of the features of NetCloak and the on-line User's Guide (in HTML format). The tutorials are included here so you can read them either online or in hard copy.

The instructions below assume that your web server supports WebStar API plug-ins and is already configured for Web service. If it is not, consult your web server documentation for instructions. If you have trouble with these instructions, see the Installation section of this guide for more detailed instructions for installing NetCloak with various web server applications.

To Install The NetCloak Introduction :

  1. Expand the compressed NetCloak demo package, or insert the NetCloak disk and run the installer to install the NetCloak 3.1 folder on your hard disk.
  2. Copy the NetCloak Plug-In to your server's plug-ins folder.
  3. Open the NetCloak Introduction folder, and copy the entire contents to your web server's root folder. If your web server software supports multiple root folders, copy it to your "default" or "main" root folder.
  4. Start up the web server, open your browser and load the following URL:

    http://your.server/NetCloak.nclk

     

  5. You'll need to substitute the address of your Web server for "your.server", of course.

The NetCloak Demo and Information page should appear, with some of the basics about NetCloak, examples of what you can do with it and tutorials to get you started using NetCloak yourself. The tutorials are also included here in the User's Guide. Flip forward to the tutorial section and you can follow along in the book.

The Installation section in this guide has detailed and specific instructions for installing NetCloak with various Macintosh web servers. If the simple instructions above do not work, refer to the detailed steps described in the Installation section.

Creating Dynamic "Cloaked" Pages

With NetCloak installed, you are now ready to add cloaking commands to pages on your Web site, as described in this section.

We strongly recommend that you be completely comfortable writing HTML pages before you start using NetCloak. If you are not familiar with HTML you can get more information from a variety of sources. In addition to numerous books on HTML, there are many tutorials available on the Web. Once you are familiar with HTML, adding NetCloak features to your pages is easy.

Using NetCloak Commands in Your Pages

The NetCloak plug-in will automatically configure your server so that any page ending in ".nclk" will be processed by NetCloak. In other words, once you have dropped the NetCloak plug-in into your Web server plug-ins folder and restarted the server, all ".nclk" files will be "cloaked". (In addition, all forms with an action URL ending in ".FDML" will automatically be processed by NetCloak Pro.) You can also choose to have NetCloak process all HTML pages on your server by setting the ".HTML" suffix mapping within your Web server to be processed using the "CLOAK_PI" action. See the "Installation" section of this guide for complete details.

Inserting Dynamic Information

NetCloak provides new commands that you can incorporate into your HTML pages to add dynamic, interactive elements to your site with remarkable ease. While NetCloak commands are not standard HTML tags, they are processed entirely on your web server, so they work with any Web browser.

All NetCloak commands begin with an opening angle bracket ("<"), just like HTML tags. Commands are closed with a closing angle bracket (">"). The NetCloak command name always immediately follows the opening bracket. Command names are not case sensitive, but are generally written in all uppercase by convention; this makes them easier to recognize in HTML pages.

The best way to start using NetCloak is by working with NetCloak's INSERT commands, which are used to add dynamic information into any cloaked page. For example, to add the current time and date, simply place the commands <INSERT_TIME> and <INSERT_DATE> in the text of any cloaked page, as in:

It is <INSERT_TIME> on <INSERT_DATE>.

NetCloak INSERT commands all display, or insert information from the server into the page in place of the command. For example, when loaded by a Web browser, the first sample line shown above will appear something like this:

It is 12:47 on December 14, 2000.

The time and date displayed will change every time the page is loaded, and will always reflect the current time and date on the server.

Similar commands allow you to dynamically display the user's name or IP address, cookies or user-entered variables and other information about the client, page, request or server.

Many NetCloak commands have required or optional additional parameters. In other words, additional settings that specify differences in how the information displayed by the INSERT command should be shown. Parameters must be specified in order, according to the command description in the Reference Guide, and are separated by one or more spaces.

For example, the <INSERT_DATE> command offers two optional parameters, one for a "time offset" and one for the desired format. The offset allows you to specify a number of hours difference between the actual date and what is displayed. The format parameter allows you to override the default display format and display the date as either a short date or long date. For example, to show tomorrow's date as a short format, you would write:

In 24 hours, it will be <INSERT_DATE +24 SHORT>.

On a web page, users will then see something like:

In 24 hours, it will be 12/15/00.

What is noteworthy is that parameters can be added after the command name, are separated by spaces, and are inside the angle brackets around the command. Parameters for each command are something you will learn later as you start using more NetCloak commands. See the Reference Guide for details on the parameters for each command.

More INSERT Commands

There are many different INSERT commands, dealing with date and time, counters, file information, and more. We will cover a few here to get you acquainted with the range of commands that are available.

Browser Information

Several commands allow you to display a variety of information about the browser. <INSERT_CLIENT>, for example, will display the name of the client Web browser, as reported by the browser itself. The command <INSERT_DOMAIN> displays the user's IP Address or domain name. Later we will see how to change the content of pages dynamically based on the same information.

Countdown

NetCloak also has a unique command which will insert the amount of time remaining until or elapsed since a specified date and time. The best (and all too common) example of this was the "Millennium Counter" displayed on many Web sites in 1999 that showed the time remaining until midnight December 31, 1999. Even though New Years Day 2000 has passed, the <INSERT_COUNTDOWN> command is still plenty useful. For example:

The big sale ends in just 6 hours!

or

Our plant has worked 158 days without a lost time accident!

You can use this command to count down the time until a holiday, meeting or other future event as well as counting time elapsed since a past one. The <INSERT_COUNTDOWN> command has options to display the time period in minutes, hours, days, weeks or any combination of those units.

Counters

One of NetCloak's simplest and most useful insert commands is <INSERT_COUNT>. This command, as you would expect, inserts a counter into the page that is incremented every time the page is served.

The counter will be inserted as text in your HTML document. Any surrounding formatting tags will affect the display of the counter inserted by NetCloak.

You can create any number of counters simply by giving each one a unique name. By naming your counters you can have a separate counter for different pages, or refer to the same counter on more than one page.

A complete list of INSERT and other commands is in the NetCloak Reference Guide.

Create A Cloaked Page

You are now ready to create a cloaked page. First, we'll create a simple page from scratch, to show just how straightforward "cloaking" is.

1. Create a new document with a text editor, preferably BBEdit or SimpleText.

2. Enter exactly one line:

Accessed <INSERT_COUNT> times.

3. Save the file in your Web server root folder as "test.nclk".

4. Go back to your Web browser, open a new window, and access the URL:

http://www.yourserver.com/test.nclk

Of course, you must replace "www.yourserver.com" with the name or IP address of your Web server.

The browser should display the line as "Accessed 1 times." If you reload the page, the counter should increment automatically.

That's it! You've created your first cloaked page.

You can now start using NetCloak INSERT commands in pages on your Web site. Remember that NetCloak commands will only work in pages processed by NetCloak. All files with names ending in ".nclk" are automatically cloaked, so without additional server setup you can only use these commands in pages with the ".nclk" suffix. While you are evaluating the NetCloak demonstration version, we recommend that you name or re-name pages with the suffix ".nclk" when you use NetCloak commands in them.

NetCloak Tip: If you ever have problems with commands not working as expected, try using TagBuilder to add the commands to your page. By using TagBuilder, the text of the command will be dropped into your page for you, avoiding possible syntax mistakes and typos. It also provides a handy list of available commands which is ideal when you are learning to use NetCloak.

Extensions for creating NetCloak commands in your pages with BBEdit or Dreamweaver are also provided in the NetCloak package.

Conditional Pages

While NetCloak INSERT commands are easy to use and a quick way to add new, dynamic features to your Web site, NetCloak's real power is in its ability to create conditional HTML. In other words, with NetCloak you can create pages that change in different circumstances- based on the user, browser or other conditions.

HIDE and SHOW Overview

Think of your Web page as a stream of water flowing through a faucet. This analogy isn't far off the mark, as HTML pages are actually nothing more than text "streams" sent by your Web server, which is the "faucet". NetCloak "SHOW" and "HIDE" commands allow you to control the stream within the page, stopping the flow of text and then resuming it later.

Here is an example of the simplest possible HIDE and SHOW logic:

This line is visible to Web browsers.

<HIDE>

This line is not visible, even when users view the HTML source.

<SHOW>

The first line in this example will be sent to any remote Web browser under any circumstance (assuming there were no prior HIDE commands in the page). The HIDE command turns off the stream of text going to the browser. After the next line, which will be hidden from all browsers, a SHOW command is used to turn the stream of text back on.

The HIDE and SHOW commands, as used here, are unconditional. In other words, the <HIDE> command will always turn off the text stream and the <SHOW> command will always turn it back on. By themselves, unconditional SHOW and HIDE commands are not very useful. Conditional SHOW and HIDE commands are much better, and we will see them next.

NetCloak Note: The analogy of a stream of water flowing through a faucet has a flaw when taken literally. When you turn a faucet off, the water stops flowing through the pipe, and when you turn it back on, the flow of water resumes from where it left off. This is not the case with NetCloak. When you use a NetCloak HIDE tag, the text stream to the browser is interrupted but the page continues to be processed at the server, and when a SHOW command is encountered, the text stream to the browser resumes from that point. Text between the HIDE and SHOW commands is lost as far as the browser is concerned.

Adding Conditions

NetCloak HIDE and SHOW commands that depend on various conditions are much more useful than the unconditional ones. The conditions that the commands will depend on are actually information on the server, like the time of day, the value of a variable, or client's IP address. In other words, NetCloak will compare the current value to some specified value (or values) and hide or show text following the command based on the result of the comparison.

Some simple uses for this include showing a different message in the page depending on whether it is morning, afternoon or night; including text (or hiding text) from a certain number of visitors or on a certain day; or hiding links on the page based on where the user is loading the page from. This section has a few simple examples to introduce the concepts, and then will let you discover more commands and uses for them by exploring other examples and the Reference Guide. Once you are comfortable with the commands, you should also take a look at the more complex examples linked from the Introduction page.

Example: HIDE and SHOW by Time

You can use NetCloak's SHOW_TIME command to have your server recognize the time and greet a user according to the hour:

<HIDE><SHOW_TIME EQUALS 05 06 07 08 09 10 11>

Good Morning!

<HIDE><SHOW_TIME EQUALS 12 13 14 15 16>

Good Afternoon!

<HIDE><SHOW_TIME EQUALS 17 18 19>

Good Evening!

<HIDE><SHOW_TIME EQUALS 20 21 22 23 00 01 02 03 04>

Good Night!

<SHOW>

Here in Chicago, it is <INSERT_TIME SHORT>.

The HIDE and SHOW TIME commands are based on a 24 hour clock, and here we specify multiple comparison constants. By using several constants, the command will be triggered if the current hour is equal to any of the hours specified. In this case, the first line turns on the stream of text on when the current hour is 05, 06, 07, 08, 09, 10, or 11. In other words, the stream is turned on if the current time on the server is between 5:00 a.m. and 11:59 a.m., and the server will then say "Good Morning!".

In any case, the next to last line unconditionally turns the stream back on for all cases with a SHOW command so that the server will send the current time following the greeting.

You can use a similar technique with the HIDE_DATE command to show a message on specific date(s). See the Reference Guide for details on the HIDE_DATE command.

NetCloak Tip:Any time you are using conditional commands that don't seem to be working, add the corresponding INSERT command to the page at the point where the HIDE and SHOW logic appears. In the example above, if the greeting message is incorrect during testing, the INSERT_TIME command will show the current time, which will help to resolve the difficulty. For example, if the server's clock is set incorrectly, the INSERT_TIME command will reveal the problem instantly.

Compatibility and Security

If the previous example with SHOW_TIME is served through NetCloak, the View Source or Show Source command in the browser will reveal that the NetCloak commands do not appear at all... only the message appropriate to the current time ("Good Morning", "Good Afternoon", "Good Evening" or "Good Night"). The NetCloak commands are never sent to the browser. This is because NetCloak is processing the HIDE and SHOW commands on the server, and the HTML is only sent to the browser after the commands have been processed.

Processing the commands on the server has two advantages: compatibility and security. Since only plain-vanilla HTML is ever sent to the browser, there is never any risk of the browser being incompatible with the NetCloak commands. Your dynamic pages will always work no matter what browser the user views them in. This is true for search engines and other non-human browsers, too.

When the commands are processed on the server, they are never sent to the browser. Users cannot "peek" inside your dynamic pages to see what is going on or find information or options that are hidden by NetCloak. This means that no-one will steal your NetCloak code or see something you are hiding with NetCloak when they view the source of the page.

Example: Hiding Internal Links

Consider a home page with a series of navigation links, like this:

<A HREF="/Contact.html">Contact Us</A>
<P>
<A HREF="/Help.HTML">Help Using This Site</A>
<P>
<A HREF="/InternalHome.html">For Employees Only</A>
<P>

In this example, the first two links on the page are intended for every user that comes to the page. The third link, however is for employees only. This page might provide a menu of local intranet applications, databases, Web management features, etc. While the internal only page may be password protected, it is much more secure for outside users to never see the link to the internal site. Outside users won't be curious or confused by links that they are unable to follow and are not meant to access.

NetCloak can be used to hide this link from outside users by checking the client's TCP/IP address. If the local network TCP/IP address range is from 192.168.1.1 through 192.168.1.255, for example, the internal only link can be hidden like this:

<A HREF="/Contact.html">Contact Us</A>
<P>
<A HREF="/Help.HTML">Help Using This Site</A>
<P>
<HIDE><SHOW_DOMAIN BEGINS 192.168.1.>
<A HREF="/InternalHome.html">For Employees Only</A>
<P>
<SHOW>

You can see above that SHOW and HIDE commands, like INSERT commands, begin with the full command name and are followed by parameters that specify the conditions when the SHOW or HIDE command will be triggered. Usually the parameter list begins with a comparison operator, followed by one or more values to be compared.

The interesting addition is the fifth line, which starts with an unconditional HIDE command. This turns the text stream off for all users. Immediately following this command is a SHOW_DOMAIN command, which will turn the text stream back on for any user whose TCP/IP address BEGINS with "192.168.1.". In other words, the stream is turned back on only for users on the local network. The internal only link is then sent only to those users. When the HTML designed only for internal users is complete, a SHOW command turns the text stream back on for all users.

SHOW Never Hides, And HIDE Never Shows

An important point to note in the above example is that the SHOW_DOMAIN command is preceded by a HIDE command. If the text stream is already on when a NetCloak SHOW command is encountered, then the result of the SHOW condition is irrelevant and the text stream will remain on after the command executes. To follow the water faucet analogy: if the faucet is on, it will remain on until it is turned off. If you want to have the faucet turned on only if a certain condition is true, you must first turn it off.

This behavior, at first, can lead to mistakes in creating conditional HTML. But ultimately it provides a great deal of flexibility in creating complex conditions. As you get started with NetCloak, just remember to precede conditional HIDE commands with <SHOW>, and conditional SHOW commands with <HIDE>. Thinking in terms of SHOW and HIDE may take a little getting used to. Keep the faucet analogy in mind and soon you will get more comfortable with it.

NetCloak Tip: The examples shown here are used to SHOW and HIDE various text messages, but NetCloak can be used to control any HTML element. The text stream that is turned on and off can contain text, formatting options, embedded images, hypertext links, or any other HTML content.

Example: Hide and Show with Counters

Counters can also be used to create conditional HTML. Here is an example that will display a special message to the first 100 people that come to your Web site:

<HIDE><SHOW_COUNT Winners LT 100>
Congratulations, you are lucky visitor number <INSERT_COUNT Winners>!
<P>
<A HREF="winner.html">Click Here To Collect Your prize</A>
<SHOW>

Here, when the counter Winners is Less Than (LT) 100, the winner message will be displayed, the user will be told what visitor number they are, and a link will be shown to direct them to directions for claiming their prize. It is important to always use HIDE and SHOW COUNT commands along with an INSERT_COUNT command, since HIDE and SHOW COUNT will not increase the counter value. Without the INSERT_COUNT command, the "Winners" counter would never increase and the winner text would always be displayed, even after the first 100 times the page is served.

Example: Identifying Users with NetCloak

Another common HIDE command is HIDE_USERNAME. This command can be used to present users with different information based on their access privileges. For example, let's say that both Bob and Tim have access to a Web page. While both users have access to the same Web page, a single item on that page can be hidden from Bob like this:

<SHOW><HIDE_USERNAME "Bob">
This message is for Tim only... Bob won't see it.
<SHOW>

Note that this is essentially the same as:
<HIDE><SHOW_USERNAME "Tim">
This message is for Tim only... Bob won't see it.
<SHOW>

In the first example, the message is hidden from Bob but displayed to everyone else. In the second, the message is shown only to Tim but hidden from everyone else. Consider this difference carefully when building pages with conditional commands.

If there are only these two users the different examples above function identically. This will probably not be the case, though. The logic of the first is "hide only from Bob" and logic of the second is "show only to Tim". The first, as you can see, will be shown to everyone, not just Tim, but the second will be hidden from everyone except Tim.

Please note that the HIDE and SHOW_PASSWORD and HIDE and SHOW_USERNAME commands will not request the user to enter a username and password. They work based on what has already been entered. If you want to have the user's Web browser display a dialog box requesting the user to enter a password, you will need to use the NetCloak REQUEST_PASSWORD command, or some other security tool.

NetCloak PASSWORD commands will properly act on the user's password, regardless of what security tool required the password initially. For example, if the user enters a password to gain access to a secure realm defined in your Web server software, the password will still be available to NetCloak for conditional processing.

Example: Tailoring Pages to Different Browsers

A constant challenge to web designers and developers is that different browsers on different platforms display HTML pages differently. For example, Windows browsers tend to display text larger than Mac browsers. Fortunately, NetCloak allows you to recognize the Web browser and create conditional HTML based on it. Here is the example:

<HIDE><SHOW_CLIENT CONTAINS "Win">
<FONT SIZE=-2>
<SHOW>

In this sample, the HTML FONT command will be sent to any client whose name includes "Win". NetCloak CLIENT commands are another excellent case where an INSERT command can be helpful. If you want to create conditional HTML based on the client type, use an INSERT_CLIENT command on a page, then load the page in several different browsers to see exactly how the browsers identify themselves.

By now, hopefully, the logic behind conditional HTML is starting to become clear. There are many more examples in the Reference Guide and on the NetCloak Examples Server at http://examples.maxum.com/

More Useful Commands

By now, you should be starting to get a feel for the kinds of things that NetCloak can do on your site. This page will introduce some more NetCloak commands, starting with a couple that that can be incredibly useful.

The REDIRECT Command

The REDIRECT command, as you would expect, allows you to redirect the client from a page on your site to another URL. This happens without the user clicking a link- the new URL just appears in their browser like magic. REDIRECT alone can solve a myriad of site maintenance problems where published URLs must remain even though you have restructured the site.

Using the REDIRECT command is fairly simple. Just include the URL you wish to redirect the user to. The URL need not be on your own site- it can be any URL at all. For example:

<REDIRECT "http://www.maxum.com/ NetCloak/UsersGuide/">

REDIRECT has the same effect as a META REFRESH tag, but with two important differences. Like all NetCloak commands, it is processed on the server, and so it will work with all web browsers. And, as you can see above, the command is much simpler to remember- just REDIRECT and the URL in quotes.

The REDIRECT command can be even more powerful when combined with conditional SHOW and HIDE commands. Working together, these can redirect clients to a different page depending on their browser type, the URL they requested or any other SHOW/HIDE comparison. There are several examples of this technique on examples.maxum.com which you will see later.

The REQUEST_PASSWORD Command

Another useful command is REQUEST_PASSWORD, which allows you to require the user to enter a username and password to gain access to the page that includes the command. For example, to protect a page so that only the users Tim and Bob can access it, you could add this command to the page:

<REQUEST_PASSWORD "Realm" "Bob,Murphy" "Tim,Ross">

The first parameter (Realm) is sent to the browser as part of the password challenge. Most browsers will display this text in the password dialog box to give the user a note as to what page or service they are logging in to. For this parameter, you can use any text you like, and it will be passed through to the browser. The message usually looks something like this:

Enter a password for [realm]

After that, a list of username and password pairs tells NetCloak which users have access to the page.

Note that NetCloak will also track user accounts for you, allowing you to create several groups of users without having to include all of their usernames and passwords in the REQUEST_PASSWORD command itself. For complete details, see the command description in the Reference Guide.


Copyright © 1996-2000 Maxum Development Corporation

http://www.maxum.com/
Previous | Next
Contents