Version 2.1


NetCloak

User's Guide


"Dynamic Web Sites...

...No Programming Required"


Commands

Once your HTML files are being served through NetCloak, you can add commands right into the text of your HTML documents.

There are three classes of commands for doing this, with numerous variations of each. The first two types of commands let you hide or show portions of your document in various situations. The third allows you to easily insert variable text into your document.

To make it easier to find what you are looking for, the command descriptions are broken down by their variations:

Commands: Unconditional
<HIDE>
<SHOW>
Commands: Client Domain
<HIDE_DOMAIN domain1 domain2 ...>
<SHOW_DOMAIN domain1 domain2 ...>
<INSERT_DOMAIN>
Commands: Time
<HIDE_TIME time1 time2 ...>
<SHOW_TIME time1 time2 ...>
<INSERT_TIME offset format>
Commands: Day of Week
<HIDE_DAY day1 day2 ...>
<SHOW_DAY day1 day2 ...>
<INSERT_DAY offset>
Commands: Date
<HIDE_DATE low high>
<SHOW_DATE low high>
<INSERT_DATE format>
Commands: Access Count
<INSERT_COUNT counter>
<HIDE_COUNT lowvalue highvalue counter>
<SHOW_COUNT lowvalue highvalue counter>
Commands: Time Countdown
<INSERT_COUNTDOWN_WDHM date@time "label"...>
Commands: Client Type
<HIDE_CLIENT client1 client2 ...>
<SHOW_CLIENT client1 client2 ...>
<INSERT_CLIENT>
Commands: User Name
<HIDE_USERNAME user1 user2 ...>
<SHOW_USERNAME user1 user2 ...>
<INSERT_USERNAME>
Commands: User Password
<HIDE_PASSWORD password1 password2 ...>
<SHOW_PASSWORD password1 password2...>
<INSERT_PASSWORD>
<REQUEST_PASSWORD realm>
Commands: Referring Document
<HIDE_REFERRER referrer1 referrer2 ...>
<SHOW_REFERRER referrer1 referrer2...>
<INSERT_REFERRER>
Commands: Random Number
<HIDE_RANDOM percent range>
<SHOW_RANDOM percent range>
<INSERT_RANDOM range>
Commands: Random Extensions
<HIDE_SAMERAND percent>
<SHOW_SAMERAND percent>
Commands: Redirecting
<REDIRECT "URL">
Commands: File Information
<INSERT_MODIFIED filename>
<INSERT_FILESIZE filename>
Commands: URL
<HIDE_THISURL url1 url2 ...>
<SHOW_THISURL url1 url2 ...>
<INSERT_THISURL>
Commands: User-Entered Variables
User-Entered Variables
<HIDE_VARIABLE variable "text">
<SHOW_VARIABLE variable "text">
<INSERT_VARIABLE variable>
Commands: Toggling Show/Hide Mode
<FLIPMODE>
Commands: Executing CGIs
<EXEC_CGI "application name" "direct" "beginfilter" "end filter">
Commands: HTTP Header
<HIDE_HEADER "text">
<SHOW_HEADER "text">
<INSERT_HEADER>

Commands: Unconditional

<HIDE>

Specifying <HIDE> in your document will hide any text, links, etc. in your document until you specify otherwise. <HIDE> is unconditional; when you use <HIDE>, text following the command is hidden from all users, all of the time.

<SHOW>

Specifying <SHOW> makes all following HTML text viewable by all users, all the time.

For example, this cloaked document:

Here is my HTML text.
<HIDE>
This will never be seen by anyone.
<SHOW>
This is the end.

Is the exact same as this HTML:

Here is my HTML text.
This is the end.

NetCloak's <HIDE> and <SHOW> commands make it possible to include notes or comments in your HTML documents that won't be revealed to users if they view or save the source of the document from their browser.

Commands: Client Domain

<HIDE_DOMAIN domain1 domain2 ...>

Any HTML text that follows <HIDE_DOMAIN> will be hidden from those people in the domains listed until the next <SHOW> command. You may specify as much or as little of the domain address as you like. For example:

<HIDE_DOMAIN 123.456.>

and

<HIDE_DOMAIN 123.>

would both hide text from the browser with the address of "123.456.78.9". The second command would also hide the text from a browser at the address "123.654.932.10", but the first would not. Specifying more of the address just makes the command more restrictive.

When comparing the address(es) in the command to the actual client address, NetCloak starts with the first character and continues comparing until it reaches either the end of the client address or the end of the parameter. If the end of the address is reached before the end of the parameter, it is not considered a match, and the command will not hide the HTML following it.

Multiple domains may be specified as well. For example, to hide text from sub-domains 123.456 and 123.89, use:

<HIDE_DOMAIN 123.456 123.89>

A space is used between each domain, and you may specify any number of domains (limited only by the maximum document size).

<SHOW_DOMAIN domain1 domain2 ...>

Any HTML text that follows will be visible to people in the listed domains. (See <HIDE_DOMAIN> above for details.)

<INSERT_DOMAIN>

This command will place the user's address, as text, into your document at the specified point. <INSERT_DOMAIN> may be a somewhat misleading name (it might better be called INSERT_ADDRESS), but is used to keep the naming consistent. Here is an example:

Your TCP/IP address is: <INSERT_DOMAIN>.

Commands: Time

<HIDE_TIME time1 time2 ...>

The HTML text that follows this command will be hidden during the specified times. Time is expressed in military time and can be specified in hours, tens of minutes, or minutes. For example, to specify hiding text during the ten o'clock hour, use:

<HIDE_TIME 10>

Multiple times may be specified as well. So, to block access to the text block from 10:00 to 10:30, you would use the command:

<HIDE_TIME 10:0 10:1 10:2>

<SHOW_TIME time1 time2 ...>

Any HTML text that follows this command will be visible to users during the specified times.

<INSERT_TIME offset format>

The offset and format parameters are optional on this command. When offset is not present, <INSERT_TIME> will place the current time, as text, into your document at the specified point. If the format parameter is not used, then the time will be displayed according to the default time format setting (See the "Configuration" section for details). You can override the default by specifying "SHORT" or "LONG" as the format parameter in the command.

Here is an example:

The current time is <INSERT_TIME LONG>.

In this case, the time will be inserted into the page, and include seconds.

An offset is a positive or negative number that specifies the number of hours difference between the actual system time and the time that should be displayed. In other words, an offset of +2 will display the current time plus two hours. An offset of -4 would display the time less four hours. This can be used to show times that vary between time zones.

For Example:

The time in Chicago is <INSERT_TIME SHORT>.

The time in California is <INSERT_TIME -2 SHORT>.

The Time in New York is <INSERT_TIME +1 SHORT>.

A plus ("+") or minus ("-") sign is always required when specifying an offset.

Commands: Day of Week

<HIDE_DAY day1 day2 ...>

This command hides the HTML text on the specified day(s). The valid days are MON, TUE, WED, THU, FRI, SAT, SUN. As always, multiple days may be specified, as in this example, which would hide text during the work week:

<HIDE_DAY MON TUE WED THU FRI>

<SHOW_DAY day1 day2 ...>

This command shows the HTML text following the command on the specified days.

<INSERT_DAY offset>

The <INSERT_DAY> command will place the current day, as text, into your document at the specified point. Here is an example:

Today is <INSERT_DAY>.

As in the <INSERT_TIME> command, the "offset" parameter is an optional parameter that specifies a number of hours to offset the day. Note that the offset is specified in hours, days, because you may want to show the day in a different time zone.

Commands: Date

<HIDE_DATE low high>

<HIDE_DATE> allows you to hide portions of your page during a specified date range (defined by the "low" and "high" dates). For example, to have a page change in 1997, you might use:

<SHOW>
<HIDE_DATE 1/1/97 12/31/97>
The year is 1996. (This will be hidden in '97.)
<SHOW>
<HIDE_DATE 1/1/96 12/31/96>
The year is 1997. (This was hidden during '96.)
<SHOW>

An asterisk (*) can be used as the "low" value to mean "any date earlier than". Using an asterisk for the high value means "any date after". For an example, see the <INSERT_COUNTDOWN> section below.

<SHOW_DATE low high>

This command shows the HTML text following the command on the specified dates.

<INSERT_DATE format>

Insert_Date will place the current date, as text, into your document at the specified point.

The date format will depend on your "Date and Time" Control Panel settings as well as the "configuration" menu setting in NetCloak. You can override the default format setting by specifying either "SHORT" or "LONG" as the format parameter. The Control Panel allows you to configure two date formats: long and short.

Here is an example:

The current date is <INSERT_DATE SHORT>.

This will display the current date with the "Short" date format specified in the date and time control panel.

Commands: Access Count

<INSERT_COUNT counter>

Insert_Count will place an incremental number in the document. The number increases by one each time the command is executed.

The "counter" field is not required, but is used so that you can maintain any number of individual page counters. If no "counter" is specified, then a default counter is used. The counter name is not case sensitive.

Here is an example:

Cloaked documents served: <INSERT_COUNT>
<P>
This page served: <INSERT_COUNT ThisPage>

You could include this example in any number of cloaked documents, changing the counter name "ThisPage" in each document. The first counter in this example (without the counter name) would be incremented each time any of these pages was accessed, whereas the second line would be incremented for each individual page.

To display a counter without updating it, use the variation <INSERT_COUNT#>. For example:

This document served: <INSERT_COUNT MyPage>
<P>
That's <INSERT_COUNT# MyPage> times!
<P>
<INSERT_COUNT# MyPage> is quite a few times!
<P>
The Home Page has been accessed <INSERT_COUNT#> times.

This page would only increment the "MyPage" counter once, and would not increase the default counter (used, in this case, for the "Home Page") at all.

You can also increment counters without displaying them by using the variation <INSERT_COUNT*>. This allows you to increment counters on each page of your server and then display them on a separate statistics page.

<HIDE_COUNT lowvalue highvalue counter>

In addition to displaying page counters, you can show and hide based on their values. <HIDE_COUNT> checks the counter specified by "counter" to see if it falls within the range defined by "lowvalue" and "highvalue". Here is an example...

This document served
<INSERT_COUNT MyPage> times.
<BR>
<HIDE_COUNT 0 50 MyPage>
This line will be shown only after the page has been accessed 50 times.

Note that the <HIDE_COUNT> command does not increment the counter, so you will normally need to use this command in conjunction with either <INSERT_COUNT> or <INSERT_COUNT*>.

<SHOW_COUNT lowvalue highvalue counter>

This command is the <SHOW> version of the count commands. See <HIDE_COUNT> for details on how it works. The <SHOW_COUNT> command works exactly the same, except that text becomes shown instead of hidden. For example, the following section would give a special note to the 100th person accessing your site...

<INSERT_COUNT* Winner>
<HIDE>
<SHOW_COUNT 100 100 Winner>
You are lucky caller number 100!
<SHOW>

Commands: Time Countdown

<INSERT_COUNTDOWN_WDHM date@time "label"...>

Counting down to a specified day or time is handy when you have some event approaching that you would like to highlight. For example, you might want to count down the days until a big sale, or a mid-term exam, or the roll out of a new feature of your Web site. Using the command is simple, just include the command and specify the date (and optionally the time) you would like to countdown to. For example:

The new century starts in
<INSERT_COUNTDOWN_WDHM 01/01/2000>.

The <INSERT_COUNTDOWN> command has several variations, specified by the "WDHM" at the tail end of the command. The letters "WDHM" stand for "Weeks", "Days", "Hours", and "Minutes".

Any combination of these characters are allowed, and they give you control over exactly what is displayed. For example, to countdown the hours until Christmas of 1996, you would use:

Christmas '96 is in
<INSERT_COUNTDOWN_H 12/25/1996>.

You may also countdown to a specific time (with time expressed in military format), as in:

I'll have Thanksgiving dinner in <INSERT_COUNTDOWN_M 11/28/1996@16:00>
<P>
Too many minutes? How about <INSERT_COUNTDOWN_DM 11/28/96@16:00>?

Valid dates are between January 1st, 1990 and January 1st, 2030.

Also, the <INSERT_COUNTDOWN> command will also count up, if the date (and or time) specified is in the past.

For example...

My son is <INSERT_COUNTDOWN_WD 5/6/93> old, and my daughter is <INSERT_COUNTDOWN_WD 12/2/94> old.

To avoid having the counter reverse itself and begin counting upward, you may want to use the <SHOW_DATE> and <HIDE_DATE> commands. For example, the text of your page would be confusing the day after Christmas unless you change the example above to:

<HIDE>
<SHOW_DATE * 12/24/96>
Christmas is in <INSERT_COUNTDOWN_H 12/25/1996>.
<HIDE>
<SHOW_DATE 12/25/96 12/25/96>
Merry Christmas!
<HIDE>
<SHOW_DATE 12/26/96 *>
Christmas is in <INSERT_COUNTDOWN_H 12/25/1997>.

NetCloak will automatically insert the labels "Weeks", "Days", "Hours", and "Minutes" as part of the text, but these defaults can be changed. Please note that all four labels must be specified, even if they will not all be used. Also, don't forget to include quote marks around each label.

My son is <INSERT_COUNTDOWN_WD 5/6/93 "wks" "dys" "hrs" "mns"> old, and my daughter is <INSERT_COUNTDOWN_WD 12/2/94 "wks" "dys" "hrs" "mns"> old.

When the page is served, this example will look something like this:

My son is 167 wks 3 dys old, and my daughter is 92 wks 5 dys old.

Commands: Client Type

<HIDE_CLIENT client1 client2 ...>

This command hides the HTML text to anyone using the specified Web Browser.

Unfortunately, it is impossible to give a complete list of Web Browsers here, since new client applications are certainly going to become available. The best way to find out the name of an individual browser is to set up your cloaked page, and then access it from the browser in question. The status window of NetCloak will display the name of the browser when the document is served.

As in the other <SHOW> and <HIDE> commands, you only need to specify the first few characters of the name. It is best to specify enough of the browser name to uniquely identify it without specifying so much that different versions of the same browser are treated differently (unless that is the desired effect). For example, NCSA Mosaic for the Macintosh might currently be called "MacMosaic 2.0.0", but to hide a portion of your HTML document from these clients, you would probably just use:

<HIDE_CLIENT MacMosaic>.

Also, since a space is used as a delimiter in NetCloak, use a wildcard character (*) to specify a space within a browser name. This will match anything, including the space in the client name, and keep NetCloak from thinking you are trying to specify two separate client names. For example, if you wanted to hide text from version 1 of NCSA Mosaic for the Macintosh, you might use:

<HIDE_CLIENT MacMosaic*1>.

Finally, the string of characters you use in this command can appear anywhere in the name of the client. For example, to hide text from all versions of Mosaic, including Windows and others, you could simply use:

<HIDE_CLIENT Mosaic>.

<SHOW_CLIENT client1 client2 ...>

This command does the opposite of <HIDE_CLIENT>. Any HTML that follows will be visible only to the clients listed.

<INSERT_CLIENT>

This command will place the name of the user's web browser, as text, into your document at the specified point. The browser name is defined by the browser itself.

Here is an example:

You are using <INSERT_CLIENT> as your web browser.

Commands: User Name

<HIDE_USERNAME user1 user2 ...>

This command hides the HTML text that follows it from the specified users. As with the other NetCloak commands, you may specify a full or partial name, and you may specify any number of users. For example, to hide text from all users named "John" or "Bob", use:

<HIDE_USERNAME JOHN BOB>

To see if the user has entered a name, you can use the <HIDE_USERNAME> command without specifying a username to check. In other words, the command <HIDE_USERNAME>, used by itself, will hide text from anyone who has entered any username. See below for an example.

<SHOW_USERNAME user1 user2 ...>

HTML text that follows this command will be visible to the specified users.

<INSERT_USERNAME>

This command will place the user's name, as text, into your document at the specified point. The example below not only inserts the user's name, but tells them if a name hasn't been entered yet.

<HIDE><SHOW_USERNAME>
Hello <INSERT_USERNAME>!
<SHOW><HIDE_USERNAME>
You haven't entered a user name yet.
<SHOW>

Commands: User Password

<HIDE_PASSWORD password1 password2 ...>

This command hides the HTML text from users with the specified password. As with the other NetCloak commands, you may specify a full or partial password, and you may specify any number of passwords in the command. For example, to hide text from all people with the password "MOOF":

<HIDE_PASSWORD MOOF>

To see if the user has entered a password, you can use the <HIDE_PASSWORD> command without specifying a password to check. In other words, the command <HIDE_PASSWORD>, used by itself, will hide text from anyone who has entered any password. See below for an example.

<SHOW_PASSWORD password1 password2...>

HTML text that follows this command will be visible to users with the specified password.

<INSERT_PASSWORD>

This command will place the user's password, as text, into your document at the specified point. The following example will display the user's password if they have entered one, or a message if they haven't.

<HIDE><SHOW_PASSWORD>
Password confirmed as: <INSERT_PASSWORD>.
<SHOW><HIDE_PASSWORD>
You have not entered a password yet.
<SHOW>

<REQUEST_PASSWORD "realm">

This handy command allows you to require a password for a page without creating a realm within your Web server. It is common for Webmasters to create a realm in order to protect a single page on their site. This causes extra overhead for every file served (not just HTML pages, but graphics and other files as well) because it's URL must be checked to see if it is a member of the realm. It is also fairly cumbersome to administer, especially when there are several pages each with their own realms.

Using <REQUEST_PASSWORD>, you can conditionally require a username and password to be entered by the user. For example, to password protect a page, these lines could be added to the top of the page:

<SHOW><HIDE_PASSWORD maxum>
<REQUEST_PASSWORD "Name">
<SHOW>

The <HIDE_PASSWORD> command here will hide the following <REQUEST_PASSWORD> command when the user's password is "maxum" and just display the rest of the page. For all others, the <REQUEST_PASSWORD> command that follows would then require a password to be entered, so the page would not be displayed and instead a password entry dialog would be shown to the user. For user's who entered a password of "maxum", the rest of the page would be displayed.

Note that the condition for sending a password request could be anything. So, for example, you could require passwords at certain times of the day, or from users attempting to gain access from outside of your IP domain. Any NetCloak hide and show commands can be used to conditionally require a password.

The "Realm" parameter used in this command is sent to the browser as text and will be displayed in the username/password dialog box presented to the user. It does not need to match a defined realm on your server. It is used only as a piece of text that is shown to the user so that they know what password they are being asked to enter.


[ Previous | Table Of Contents | Next ]

Copyright © 1996 Maxum Development Corporation
820 South Bartlett Road - Suite 104
Streamwood, IL 60107
http://www.maxum.com/