|
This page contains a number of examples commonly requested for use in users' pages.
Blocks of code that can easily be inserted into NeoWebScript documents or .htaccess files and <Directory></Directory> blocks are highlighted in red.
If you're looking for more general answers to questions, you can read the NeoWebScript Frequently Asked Questions page.
Examples
Where Used:
NeoWebScript document
<nws>html [incr_page_counter]</nws> |
This will spit a number out to the page. You can surround it with any kind of HTML text you want for the counter to read like you like. |
Where Used:
NeoWebScript document
<nws>
html [display_graphic_num -font set0 [incr_page_counter]]
</nws> |
Where Used:
<Directory></Directory> block in httpd.conf
.htacess file
AuthName "Protected Area"
AuthType Basic
TclAuthBasic tcl_passwd_auth
TclAuthAccess tcl_passwd_access
require valid-user |
With this code installed, only users with an account on the system will be able to see access the directory. They must type their login and password for the system to see the directory.
NOTE:
mod_auth_tcl must have been compiled and installed on your NeoWebScript server.
|
Where Used:
NeoWebScript document
AuthName "Protected Area"
AuthType Basic
TclAuthBasic tcl_db_auth username dbfilename
TclAuthAccess tcl_db_access
require valid-user |
Replace username with the person who owns the DB file and dbfilename with the name of the db file you have the users stored in. The passwords must be stored in the database using the -singleVar option to dbstore. |
Where Used:
NeoWebScript document
set fp [open filename]
while {[gets $fp line] != -1} {
} |
Replace filename with the name of the file in the local directory. If you are in a safe interpreter, you cannot open a file outside of the current directory. |
Where Used:
NeoWebScript document
set lines [read_file filename]
foreach line [split [string trim $lines] \n] {
} |
Replace filename with the name of the file in the local directory. This method is much faster and less expensive than reading the lines one-by-one. You must remember that the last in the file will cause a null element to be appended as the last element of the list. We string trim the lines to get around this. |
Where Used:
<Directory></Directory> block in httpd.conf
.htacess file
NeoWebUserConf HeaderFile header.nhtml |
Replace header.nhtml with the filename you want displayed as the header. This file will be displayed before every file in the current directory and every subdirectory beneath it. |
Where Used:
<Directory></Directory> block in httpd.conf
.htacess file
NeoWebUserConf FooterFile footer.nhtml |
Replace footer.nhtml with the filename you want displayed as the footer. This file will be displayed after every file in the current directory and every subdirectory beneath it. |
|