TalentSoft Web+®

Version 4.0

(Draft: 4.02, Date: 3/8/98)

User’s Guide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

http://www.TalentSoft.com , http://www.WebPlus.com

 

 

Copyright Notice

Copyright © 1994-1998 TalentSoft - an operation of Talent Information Management, LLC. All rights reserved.

Web+® and the Web+® logo are trademarks of TalentSoft.

Microsoft is a registered trademark of Microsoft Corporation. Microsoft Internet Explorer, Windows NT, and Windows 95 are trademarks of Microsoft Corporation.

Netscape and Netscape Navigator are trademarks of Netscape Communications Corporation.

Pentium is a trademark of Intel Corporation.

All other brand names and product names used in this book are trademarks, registered trademarks, or trade names of their respective holders.

No part of this manual may be reproduced or retransmitted in any form or by any means electronic, mechanical, or otherwise, including photocopying and recording for any purpose other than the purchaser's personal use without the written permission of TalentSoft.

TalentSoft welcomes any comments and suggestions regarding this document and the Web+® software. Please send your suggestions by email to support@TalentSoft.com , support@WebPlus.com .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TalentSoft / Talent Information Management, LLC.

Headquarters: 900 Nicollet Mall, Suite 700, Minneapolis, MN 55402, USA

Mailing Address: PO Box 2997, Minneapolis, MN 55402, USA

Tel: (612) 338-8883

Fax: (612) 904-0010

Email: info@TalentSoft.com , info@WebPlus.com

URL: http://www.TalentSoft.com , http://www.WebPlus.com

Table of Contents

Introduction *

Why Use Web+®? *

The Common Gateway Interface *

Server Application Programming Interfaces *

Web+® *

ISAPI vs. CGI *

Conclusions *

What Does Web+ Do? *

Database Integration *

File Manipulation *

Mail Integration *

CyberCash Integration *

Web+ is open-ended *

COM/DCOM Integration *

Creating Crystal Report *

FAX and PAGING *

Integration with Other Applications *

Other Capabilities *

Web+ Interpreter and Web+ Markup Language (WML) *

Web+ Interface *

Remote Web+ *

Web+ with Firewalls *

Load Distribution *

Security Issues with Remote Web+ *

Architecture *

Installation *

System Requirements *

Three Types of Web+ under Windows platforms *

Two Types of Web+ under UNIX platforms *

One Type of Web+ under IBM AIX platform *

Obtaining a Copy of Web+ *

Installing Web+ in Windows *

Automatically Restarting the Web+ Service on Windows NT *

Pipe Or Socket *

ISAPI Support - Document Type Mapping with IIS3.0 *

ISAPI Support - Document Type Mapping with IIS4.0 *

Installation Directory Tree *

Web+ 4.0 installation on Unix (Solaries, HP-UX, AIX, IRIX, Linux, etc.) *

Verifying Installation *

Upgrade Web+ Under Windows NT 4.0 *

Custom Web+ Error Messaegs Under Windows NT 4.0 *

Installation Troubleshooting *

Database Processing *

What is ODBC? *

What is a Data Source? *

What is SQL? *

Setting up ODBC Data Sources *

Creating an ODBC Data Source *

Configuring an ODBC Data Source for Web+ *

Web+ Administration *

Overview *

Using the Web+ Server Manager *

[Admin] Administration Options *

[Main] Main Options *

[Template] Setting Script Paths *

[Log] Managing the Error Log *

[Mail] Setting SMTP Mail Configuration *

[ODBC] Administering ODBC Data Sources *

[File I/O] Setting File I/O Paths and Permissions *

[webRun] Controlling Execution of External Files *

Modifying the Web+ Configuration Files Directly *

Hello, World - Writing Scripts *

Basic Process *

Creating the Script *

Checking the Syntax *

Web+ Naming and Coding Convention *

How to write Cross Platform Web+ Script *

Using the Web+ Markup Language *

Commands and Statement Tags *

Variables *

Functions *

The <webPrint> Tag *

Comments *

Manipulating Variables in a Script *

Math Operators and Functions *

String Operators and Functions *

Comparison Operators *

Logical Operators *

Precedence *

Controlling the Flow of Execution in a Script *

Conditional Statement Tags *

Looping Tags *

Miscellaneous Flow Control Tags *

Working with Data Sent by Users *

How Data is Sent *

Using Submitted Data *

Validating Form Entries *

Submitted Variable Functions *

Additional Web+ Functions and Tags *

Date and Time Related *

Working With String Lists *

Environmental Information *

Web+ Configuration *

Web+ Cache Technique *

Client State Variables *

Cookie Variables *

Miscellaneous Functions *

Miscellaneous Tags *

Printing Information Obtained From a Database *

Executing Queries with Web+ *

Printing Query Results *

Printing a Formatted List of Query Results *

File Manipulation *

Introduction to File Manipulation *

Manipulating Files *

Directories *

Doing File I/O *

Working with INI Files *

E-Mail Integration *

web_ChkMail Tag *

Sending Mail From a Web+ Script *

Invoking Web+ email from other applications : Web+ mail API *

Web+ Custom Tags *

What is a Custom Tag? *

Building custom tags in Web+. *

COM/DCOM integration *

Integrating Objects in Web+ scripts *

Crystal Report integration *

Using webReport to integrate custom crystal report *

Encryption *

Encrypting Web+ Scripts Using wmlencode.exe *

General encryption Using webPGP *

Microsoft Visual InterDev integration *

Features/Benefits of Integrating Microsoft Visual InterDev with Web+ *

Procedures for Integrating Microsoft Visual InterDev and Web+ *

Integration With Other Applications *

External File Execution *

Dynamic Linked Libraries *

Communication via Sockets *

Common Errors and Problems *

Troubleshooting *

Web+ Initialization Files *

webpmsg.ini *

webplus.ini *

webpsvr.ini *

Web+ Support Services *

Technical Support *

Sales Information *

ANSI Character Set *

Glossary *

Section 1

Overview

The rapid increase in the use of the Web by businesses has created a tremendous need for server extension applications that generate dynamic content and web to database integration. These web-based applications will allow businesses to deliver products, services, and messages dynamically and interactively.

The advent of dynamic content delivery of web pages has changed the face of web technology. This trend uncovers the weaknesses of the environment in which these applications are currently bound: CGI (Common Gateway Interface). CGI does not offer the performance these applications require. A new communication infrastructure is needed to connect Web servers with these new applications. This shortcoming prompted TalentSoft to develop Web+. Web+ is a fast, open, and secure Web server interface that solves the performance problems inherent in CGI, without introducing the overhead and complexity of proprietary APIs (Application Programming Interfaces).

TalentSoft Web+ is a powerful and rapid development tool dedicated to developing web-based client/server applications without writing complicated, low-level, and time-consuming CGI programs. Web+ enables rapid and easy creation of highly functional web pages which integrates with databases, file systems, email, Java applets, legacy applications, executable programs (EXEs), dynamic-link libraries (DLLs), and communicates with other TCP/IP applications using socket.

 

Chapter 1

Introduction

Thank you for using TalentSoft Web+®. This section will provide a clearer picture of what Web+ is, how it works and all of the things it can do. Perhaps you initially only intended on using Web+ to integrate your database with your web page, but did you know that Web+ can also manipulate files and perform file I/O? Web+ is the ultimate CGI program, allowing you to do anything with just a few simple commands.

Why Use Web+®?

Originally, whenever a web developer wanted to create a dynamic web page that integrated user interaction and databases, a Common Gateway Interface (CGI) program had to be written. Often times it was written from the ground up, which wasted time and resources. Web+ simplifies database integration so that dynamic and interactive web pages can be designed quickly and easily.

The Common Gateway Interface

The de facto standard interface for Web server applications is CGI, which was first implemented in the NCSA server. CGI has many benefits:

Simplicity

It is easy to understand.

Language Independence

CGI applications can be written in nearly any language.

Process Isolation

Since applications run in separate processes, buggy applications cannot crash the Web server or access the server’s private internal state.

Open Standard

Some form of CGI has been implemented on every Web server.

Architecture Independence

CGI is not tied to any particular server architecture (single threaded, multi-threaded).

CGI also has some significant drawbacks. The leading problem is performance: Since a new process is created for each request and thrown away when the request is done, efficiency is poor.

CGI also has limited functionality: It only supports a simple "responder" role, where the application generates the response that is returned to the client. CGI programs can’t link into other stages of Web server request processing, such as authorization and logging.

Server Application Programming Interfaces

In response to the performance problems for CGI, several vendors have developed APIs for their servers. The two most notable are NSAPI from Netscape and ISAPI from Microsoft. The freely available Apache server also has an API. Applications linked into the server API may be significantly faster than CGI programs. The CGI startup/initialization problem is improved, because the application runs in the server process and is persistent across requests. Web server APIs also offer more functionality than CGI: you can write extensions that perform access control, get access to the server’s log file, and link in to other stages in the server’s request processing.

However, APIs sacrifice all of CGI’s benefits. Vendor APIs have the following problems:

Complexity

Vendor APIs introduce a steep learning curve, with increased implementation and maintenance costs.

Language Dependence

Applications have to be written in a language supported by the vendor API (usually C/C++). Perl, the most popular language for CGI programs, can’t be used with any existing vendor API.

No Process Isolation

Since the applications run in the server’s address space, buggy applications can corrupt the core server (or each other). A malicious or buggy application can compromise server security, and bugs in the core server can corrupt applications.

Proprietary

Coding your application to a particular API locks you into a particular vendor’s server.

Tie-in to Server Architecture

API applications have to share the same architecture as the server: If the Web server is multi-threaded, the application has to be thread-safe. If the Web server has single-threaded processes, multi-threaded applications don’t gain any performance advantage. Also, when the vendor changes the server’s architecture, the API will usually have to change, and applications will have to be adapted or rewritten.

Web+®

The Web+ interface combines the best aspects of CGI and vendor APIs. Like CGI, Web+ applications run in separate, isolated processes. Web+’s advantages include:

Performance

Web+ processes are persistent-they are reused to handle multiple requests. This solves the CGI performance problem of creating new processes for each request.

Simplicity and Easy of Use

Web+ applications are written in Web+Basic, a scripting language based on the Basic programming language and the HTML. Anyone who knows Basic and HTM can start building web-based applications within hours of learning Web+.

Process Isolation and Fault Tolerance

Because Web+ applications can run on the different servers on different platforms (away from the web server), process isolation and fault tolerance can be achieved. A buggy Web+ application cannot crash or corrupt the core server (the web server) or other applications. A malicious Web+ application cannot steal any secrets (such as session keys for encryption) from the Web server.

Non-proprietary

Web+ runs on all popular operating systems (NT, Win95, Unix, Linux, etc), and supports all popular web servers (Netscape, Microsoft IIS, Apache, NCSA, etc) and ODBC compatible databases (MS Access, FoxPro, dBase, SQL Server, Oracle, Sybase, mSQL, mySQL, etc.)

Architecture Independence

The Web+ interface is not tied to a particular server architecture. Any Web server can implement the Web+ interface. Also, Web+ does not impose any architecture on the application: applications can be single or multi-threaded, regardless of the threading architecture of the Web server.

Support for Distributed Computing

Web+ provides the ability to run applications remotely, which is useful for distributing load and managing external Web sites.

ISAPI vs. CGI

To host web sites, you must have an internet server that supports the HyperText Transfer Protocol (HTTP). If you have chosen Internet Server API (ISAPI)-compliant server software, such as Microsoft Internet Information Server, you can take advantage of the webplus.dll to increase performance time and minimize system resources needed.

ISAs provide an alternative to the use of CGI (Common Gateway Interface) applications for Internet servers. Unlike CGI applications, ISAs run in the same address space as the HTTP server and have access to all the resources available to the HTTP server. ISAs have lower overhead than CGI applications because they do not require the creation of additional processes. The HTTP server can preload ISAs to reduce overhead even further. It can unload DLLs that have not been called after a specified amount of time to free up system resources.

An internet client calls an ISA through the HTTP server, the same way it would call a CGI application. For example, a client might call a CGI application as:

http://localhost/cgi-bin/webplus.exe?script=filename.wml

It would call an ISA that performs the same function as:

http://localhost/cgi-bin/webplus.dll?script=filename.wml

Since an HTTP server knows the ISAPI Applications DLLs that are already in memory, it is possible for the server to unload the ISAPI Applications DLLs that have not been accessed in a configurable amount of time. By preloading an ISAPI Application DLL, the server can speed up even the first request for that ISAPI Application. In addition, unloading ISAPI Applications DLLs that have not been used for some time will free up system resources.

Conclusions

Today’s Web business applications need a platform that’s fast, open, maintainable, straightforward, stable, and secure. The Web+ design meets these requirements, and provides for a logical extension from proven and widely deployed CGI technology. This allows developers to take advantage of the benefits of Web+ without losing their existing investment in CGI applications.

 

Chapter 2

What Does Web+ Do?

Web+ provides a gateway between the World Wide Web and SQL databases. Web+ uses the Open Database Connectivity (ODBC) interface to access a wide variety of relational databases. Web+ also offers access to e-mail systems, file manipulation and socket services. On-Line E-Commence is available in Web+ 4.0.

Database Integration

Web+ can integrate with any ODBC compliant database and make real-time queries in order to generate dynamic web pages based on the information in those databases. Any type of SQL statement can be issued to an ODBC compliant database, including SELECT, UPDATE, INSERT and DELETE giving the developer complete control over the database and the web page.

File Manipulation

Local files can be opened, read from, written to, copied, moved and deleted with Web+. These commands allow Web+ to have complete control of the file system so as to provide the greatest flexibility in file manipulation than any other WWW middleware application.

Mail Integration

With Web+ SMTP protocol, a Web+ script can automatically send e-mail to any address, or list of addresses, on the Internet. Combining the SMTP abilities and database functions of Web+, the potential exists for maintaining large customer lists and mass mailing systems easily and quickly. This grants the largest customization abilities available.

CyberCash Integration

With Web+ 4.0, it is easy to implement secure E-Commance.

Web+ is open-ended

With Web+ 4.0, it is possible for advanced developers to define custom tags, that means Web+ has unlimited power.

COM/DCOM Integration

With Web+ 4.0, the existed components can be plugged in the script.

Creating Crystal Report

With Web+ 4.0, crystal report could be easily generated on the fly.

FAX and PAGING

With Web+ 4.0, Two custom tags will handle sending fax and paging in scripts.

Integration with Other Applications

Web+ has the ability to execute, send data to and receive data from server-side applications with almost no effort. The possibilities of integration with third party software are unlimited.

Web+ can also communicate with other servers through the simple calling of sockets. POP-Mail clients can be written in just a few lines of code and automated FTP and Telnet applications in just a few more.

Other Capabilities

Web+ can, in real-time, manipulate variables and process information. To support this, there are a number of math functions and string formatting functions integrated into Web+. In addition, Web+ has the ability to include scripts within scripts. This is useful in cases where several pages have identical headers or footers. By creating just one file for a header or footer, many web pages that include these scripts can be modified by editing a single file.

 

 

Chapter 3

Web+ Interpreter and Web+ Markup Language (WML)

When the Web+ application is executed and sent a script file, Web+ reads, intrprets, and executes the script code in real-time, then returns the output as an HTML file. This scripting code is called the Web+ Markup Language, an extension of the HTML (HyperText Markup Language) format. The Web+ Markup Language consists of a set of tags and special variable indicators. Web+ command tags are conventionally preceded by the word "web" (e.g., <webPrint>, <webSet>, <webIf>). Variables and expressions in Web+ are typically surrounded by pound signs (‘#’) (e.g., #UserName#, #a + 2#, #len(FullName)#).

Web+ Interface

The functionality provided by the Web+ interface is very similar to that provided by CGI. To best understand the Web+ protocol, we review the CGI interface here. Basic CGI request processing proceeds as follows:

  1. For each request, the server creates a new process and the process initializes itself.
  2. The Web server passes the request information (such as remote host, username, HTTP headers, etc.) to the CGI program in environment variables.
  3. The Web server sends any client input (such as user-entered field values from an HTML form) to the CGI program’s standard input.
  4. The CGI program writes any output to be returned to the client on standard output. The Web server logs error information written to a standard error.
  5. When the CGI process exits, the request is complete.

Web+ is conceptually very similar to CGI, with two major differences:

Web+ processes are persistent.

After finishing a request, Web+ processes wait for a new request instead of exiting. Instead of using operating system environment variables and pipes, the Web+ client/server architecture allows Web+ programs to run on remote machines, using TCP connections between the Web server and the Web+ application.

Request processing in a single-threaded Web+ application proceeds as follows:

  1. The Web server creates Web+ application processes to handle requests. The processes may be created at startup, or created on demand.
  2. The Web+ program initializes itself, and waits for a new connection from the Web server.
  3. When a client request comes in, the Web server opens a connection to the Web+ process. The server sends the CGI environment variable information and standard input over the connection.
  4. The Web+ process sends the standard output and error information back to the server over the same connection.
  5. When the Web+ process closes the connection, the request is complete. The Web+ process then waits for another connection from the Web server.

Web+ applications can run locally or remotely.

For local applications, the server uses a full-duplex pipe to connect to the Web+ application process. For remote applications, the server uses a TCP connection.

Web+ applications are multi-threaded. Web+ server maintains a pool of processes (if the application is running locally) to handle client requests. Multi-threaded Web+ applications may accept multiple connections from the Web server and handle them simultaneously in a single process.

Remote Web+

Web+’s ability to run applications remotely (over a TCP connection) provides some major benefits. These benefits are described in this section, along with some of the security issues that affect remote Web+ applications.

Web+ with Firewalls

Applications that run on organizational (external) Web servers and depend on internal databases can be a challenge to administer. With CGI and vendor APIs, the application has to run on the Web server machine. This means the server administrator has to replicate the necessary database information onto the system hosting the Web server (which may be difficult to do in an automated way without compromising firewall security). Or, the administrator may build a "bridge" that allows access through the Web server to internal databases and applications (which is effectively re-inventing remote Web+).

With remote Web+, the applications can run on the internal network, simplifying the administrator’s job. When used with appropriate firewall configuration and auditing, this approach provides a secure, high-performance, scalable way to bring internal applications and data to the external network.

Load Distribution

For resource-intensive CGI and API applications, the Web server machine quickly becomes the bottleneck for overall throughput. The usual way to solve this performance problem is to buy a bigger, faster Web server machine, or to partition the Web site across several Web servers.

With remote Web+, the resource-intensive applications can be moved off the Web server machine, giving the server administrator additional flexibility in configuring the Web server. The administrator can configure Web+ applications "behind the scenes" without having to change any content links or the external view of the Web site. The administrator can use several smaller, inexpensive server machines for applications, and can tailor each machine to the application it is hosting.

Security Issues with Remote Web+

The two security issues with remote Web+ connections are authentication and privacy. Web+ applications should only accept connections from Web servers that they trust (the application library includes support for IP address validation). Future versions of the protocol will include support for applications authenticating Web servers, as well as support for running remote connections over secure transport protocols such as SSL or PCT.

 

 

Chapter 4

Architecture

The architecture of Web+ follows this general flow. It starts with an end user and their web browser. The connection then flows into the Internet and eventually comes to fall on a web server. This web server (which can be running any web server under any operating system) is linked, via CGI or ISAPI, to the Web+ Client (which can also be running under any operating system). The Web+ Client is linked, via a TCP/IP socket, to the Web+ Server (again, running under any operating system), which runs the Web+ script codes. It is this Web+ Server that will link to any ODBC compliant databases (once again, under any operating system), local files, SMTP servers or any other machine via a socket layer. It is this flexibility that makes Web+ a terrific integration device for dynamic web development.

 

Section 2

Web+ Administration

This part of the User’s Guide will deal with the administration aspects of Web+. Everything from installing Web+, to configuring data sources. This section will primarily only be of interest to those who have Administrator level access and the ability to configure applications. The following Programming section will contain information relevant to those who intend on using Web+ to develop applications on the World Wide Web.

 

 

Chapter 5

Installation

System Requirements

These are the Web+ system requirements for various platforms.

Platform

Hardware

Operating System

Internet Connection

Windows

486 or higher processor; (Pentium recommended); 24MB RAM for Windows NT or 16MB RAM for Windows 95; and 10MB free hard disk space.

Web+ Client/Server versions require Windows NT 3.51(or higher); Web+ Application versions require Windows 95 or NT 3.51.

A running TCP/IP network connection and a Windows 95 or NT compatible web server.

Solaris

Web+ should run successfully on any system currently running Solaris on a Sun architecture.

 

TCP/IP connection for Web+ to be accessible

Linux

Web+ should run successfully on any system currently running Linux on an x86 architecture. A Pentium with 32mb of RAM is recommended.

Linux 2.0 or greater is recommended

TCP/IP connection for Web+ to be accessible.

Three Types of Web+ under Windows platforms

Web+ is available in three different versions under the Windows platforms. All versions will work with Windows NT, but only the Desktop Executable version will work for Windows 95.

1. The Client/Server NT Service Version

The Client/Server Service version of Web+ runs as a service on Windows NT. Since it runs as a service, Web+ is able to respond to web requests even when no user is logged in on the Web+ server. This is the most efficient version of Web+.

2. The Client/Server NT Executable Version

The Client/Server Executable version runs as an application on Windows NT. Web+ will respond to web requests only when a user is logged in and Web+ is running.

3. The Desktop Executable Version

The Desktop Application version runs as an application on Windows 95 and Windows NT.

 

Two Types of Web+ under UNIX platforms

The Client/Server Service version of Web+ runs as a service on Solaris and Linux.

 

One Type of Web+ under IBM AIX platform

The Client/Server Service version of Web+ runs as a service on IBM AIX.

Obtaining a Copy of Web+

Web+ can be obtained by anonymous ftp to ftp://ftp.TalentSoft.com/TalentSoft/webplus. Windows versions are available in the directories ClientServerExe3.0 and ClientServerNTSvc3.0. Web+ for Solaris, Linux and AIX are each in the Unix directory.

Installing Web+ in Windows

When you download Web+ you will receive a self-extracting executable file, an installation password and a License ID. You will need all of these to install Web+. Put the executable file into a temporary directory and run the file to begin installation. The first thing you should see is the "Welcome" window.

Click "Next" and you will be brought to a License Agreement window. Read the License Agreement and then click "Accept" to continue on. The next window you will see will be the "Requirements for running Web+ window".

Put check marks next to each line that you can answer "Yes" to. This criteria must be met for Web+ to run with full functionality. You can still install Web+ without all of these components, but not all of the functionality will be available to you. Finally, click "Next", and you will see the "Select Destination Directory" window.

Choose an installation directory to install Web+ in. By default, Web+ will install into the directory C:\WebPlus. Click "Next" to continue. If a previous version of Web+ is found on your system, Web+ will ask if you want a backup made. If so, choose a location for the backup. Then, you will have the option to install all, or some of the Web+ files and components.

The Web+ Program Files are necessary to run Web+. The Web+ documentation files are optional manuals and references. The ODBC 3.0 selection will install ODBC drivers if you don’t already have them. Initially, you should leave all three options checked, then click "Next".

At the "Configure Web+" window, you will be prompted for your name, your company and the encrypted License ID. If this is your first time installing Web+, copy the License ID from the TalentSoft web page and just paste it into the text box. Then enter your name and company and click "Next".

The next three windows will ask for more configuration information.

The Web+ Admin Password is the password used to run the Server Manager. The Web+ Admin Email is the default email address for all Web+ related activity.

The SMTP Sever Name is the name of your mail server, and the SMTP Server Port Number is the port that the mail server uses (nearly always 25).

The HTML and CGI-BIN root paths are those that have been set by your Web Server’s Server Manager utility. In this window there is a list of the seven most popular Web Servers and their default root paths, the default is for Microsoft’s Internet Information Server. If you used the default paths set by your Web Server, you can simply copy them from the window and paste them into the text box. Finally, click "Next".

After all the configuration data has been entered, Web+ will be ready to install. Click on "Start Install" to begin. After Web+ finishes installing, it will ask you to manually create the "Webplus_Examples" ODBC data source. This data source is used by many of the Web+ example applications. Simply follow the instructions on the screen, and click "Continue" when you are finished.

Finally, Web+ is installed and configured. Changes can be made to these settings by editing the webpsvr.ini file located in the Windows directory, or by using the Web+ Server Manager via a web browser (see the section on the Server Manager for more information).

Automatically Restarting the Web+ Service on Windows NT

Web+ can be configured to automatically restart the Web+ Service (for the Windows NT Client/Server Service version only) whenever the Web+ Server stops. To set up this feature, put the webplus.ini file into the Windows NT system directory. Then edit the file and set AutoStartService=1 and WebpSvrIP to your server’s IP address.

[Main]

PipeOrSocket=1

WebpSvrIP=127.0.0.1

AutoStartService=1

If the service is started successfully, you should never receive "Communication Error" messages when running your applications.

Pipe Or Socket

In the special case when Web+ is running under Windows NT and both the Web+ client and Web+ server executables are on the same machine, you can have Web+ communicate with itself via a named pipe. A named pipe connection is faster than TCP/IP connection. To configure Web+ to use a named pipe connection, set "PipeOrSocket=0" in the webplus.ini file. If Web+ is using a named pipe to communicate, it doesn’t use the "WebpSvrIP" value.

Named pipes will only work with Windows NT. If you are using Windows 95, then you must set "PipeOrSocket=1", and use a TCP/IP socket to communicate, regardless of whether or not both the Web+ client and Web+ server are on the same machine.

ISAPI Support - Document Type Mapping with IIS3.0

If you use the Microsoft Internet Information Server web server, you can configure it to do document type mapping with Web+ script files. By default, the URL you must use to access a Web+ script fits the following format:

http://www.domain.com/cgi-bin/webplus.exe?script=/WebPlusLogicalPath/ScriptName.wml

Using ISAPI, Web+ has the ability to do document type mapping and provide a shortcut to accessing Web+ scripts. To set up document type mapping, follow these steps:

  1. Stop the web server service(World Wide Web Publishing Service).
  2. Copy the webplus.dll file from the webplus\bin directory to the web server’s physical cgi-bin directory.
  3. Install the webplus.dll file to the system registry. To do this, run the IISREG.EXE utility supplied by TalentSoft and give it the full path name of the webplus.dll file as an argument. For example:
    iisreg c:\inetsrv\scripts\webplus.dll
  4. Using the Server Manager, set the "WebpURL" (in the [Main] section) to the logical path of the webplus.dll. For example:
    WebpURL=/cgi-bin/webplus.dll
  5. Restart the web server service(World Wide Web Publishing Service).

Now you should be able to reference the script files in this manner:

http://www.domain.com/WebPlusLogicalPath/ScriptName.wml

 

ISAPI Support - Document Type Mapping with IIS4.0

If you use the Microsoft Internet Information Server 4.0 web server, you can configure it to do document type mapping with Web+ script files. By default, the URL you must use to access a Web+ script fits the following format:

http://www.domain.com/cgi-bin/webplus.exe?script=/WebPlusLogicalPath/ScriptName.wml

Using ISAPI, Web+ has the ability to do document type mapping and provide a shortcut to accessing Web+ scripts. To set up document type mapping, follow these steps:

  1. Stop the web server service(World Wide Web Publishing Service).
  2. Goto Start | Programs | Microsoft Internet Information Server | Internet Service Manager | Microsoft Management Console.
  3. In the left window of Microsoft Management Console, right click Default Web Site, then choose Properties, Now
  4. Default Web Site Properties window shows up.

    Click ADD button in ISAPI FILTER folder,

    In Filter Name field type webplus (could be any other meaningful name )

    In Executable field type c:\InetPub\scripts\webplus.dll (if it is the physical path of cgi-bin webplus.dll),

    then click OK.

  5. Using the Server Manager, set the "WebpURL" (in the [Main] section) to the logical path of the webplus.dll. For example:
    WebpURL=/cgi-bin/webplus.dll
  6. Restart the web server service(World Wide Web Publishing Service).

Now you should be able to reference the script files in this manner:

http://www.domain.com/WebPlusLogicalPath/ScriptName.wml

 

Installation Directory Tree

After installation, Web+ will create a directory on the hard drive called WebPlus (unless you specified a different directory). You should see the following directory tree in the WebPlus directory:

Directory/File Name

Description

+---readme.txt

|---unwise.exe

|---install.log

Web+ readme file

Web+ Uninstall Program (Windows version)

Web+ install log (Windows version)

+---bin

| \---webpsvr.exe

| \---webpsvc.exe

| \---webplus.exe

| \---webplus.dll

| \---webpchk.exe

| \---instwsvc.exe

| \---iisreg.exe

| \---wmlencode.exe

| \---restart.bat

| \---RestartTimer.bat

| \---backup

| | \---webpsvr.ini

| | \---webplus.ini

| | \---webpmsg.ini

| | \---webpsvr.conf

| | \---webplus.conf

| | \---webpmsg.conf

Binary directory: the executable and configuration files for Web+

Web+ Server (NT/95 Executable or Unix/Linux version)

Web+ Server (NT Service version)

Web+ Client CGI version

Web+ Client ISAPI version (NT/95 version)

Web+ script syntax checker

Web+ Server NT Service version installation program

Web+ ISAPI document mapping program

Web+ script (WML) encryption program

Web+ Server NT Service restart program (NT Service version)

Web+ Server NT Service restart timer (scheduler) program (NT version)

Backup directory: contains Web+ configuration files

Web+ Server configuration file (NT/95 version)

Web+ Client configuration file (NT/95 version)

Web+ Message file (NT/95 version)

Web+ Server configuration file (Unix/Linux version)

Web+ Client configuration file (Unix/Linux version)

Web+ Message file (Unix/Linux version)

+---database

| \---webpdb.mdb

The WebPlus_Examples physical database.

Web+ sample database in Microsoft Access 7.0 format (NT/95 version)

+---log

Web+ runtime log file. Provides detailed information about Web+.

+---mail

| +---error

| +---log

| \---spool

All mail created by the <webMail> command tag. Mail waiting to be sent is put in the spool directory, mail that can’t be sent because of some error are put into the error directory. The log directory contains a log file of <webMail> activity.

+---script

| \---webplus

The default Web+ script directory.

The sub-directory "webplus" contains all the Web+ example scripts.

+---temp

Web+ temporary files.

+---webplus

| +---classes

| \---graphics

The Web+ HTML files. This directory is copied into a WebPlus directory under the HTML root directory.

+---doc

| +---logo

| \---betaagmt.txt

| \---getatart.pdf

| \---langref.pdf

| \---quickref.pdf

| \---usrguide.pdf

Web+ documentation:

Web+ graphics and logo files

Web+ beta test agreement

Getting Started guide (Adobe Acrobat PDF file)

Web+ Language Reference (Adobe Acrobat PDF file)

Web+ Quick Reference Guide (Adobe Acrobat PDF file)

Web+ User’s Guide (Adobe Acrobat PDF file)

\---odbc

Pre-packaged ODBC drivers.

+---CrystalReports

| \---crpe32.dll

| \---implode.dll

| \---p2sodbc.dll

| \---u2ddisk.dll

| \---u2fhtml.dll

Crystal Reports DLLs for Web+ integration.

+---digits

| \---readme

Web+ counter graphics.

+---tools

| +---Msquery

| | \---Ccapi232.dll

| | \---Ccard232

| | \---Cuecrd32.dll

| | \---Msqry32.cue

| | \---Msqry32

| | \---Msqry32.gid

| | \---Msqry32

| | \---Qryint32.dll

| | \---Readme

Additional Tools

Microsoft Query (Windows Version)

+---webpapi

| \---sendemail.cpp

| \---sendemail.mak

| \---sendemail.mdp

| \---webpapi.h

Web+ Custom Tag API samples.

\---install

\---readme

\---unwise

 

 

If any of the above file do not exist, please contact TalentSoft’s Technical Support at (612) 338-8883.

 

Web+ 4.0 installation on Unix (Solaries, HP-UX, AIX, IRIX, Linux, etc.)

1. Basic requirements

2. Installation of Web+

3. Directory structure of Web+ 4.0

4. Trouble shooting

1. Basic requirements

Web+ 4.0 can run in most Unix platforms, including Linux, Unix, Sun Solaris, HP-UX, IBM AIX, SGI IRIX, and others. Before you can successfully install Web+ 4.0 in your machine, make sure you have already installed a web server (HTTPD), you also need to collect information regarding to the server type, directory.

Web Server

There are several kinds of Web server software running on Unix platforms, The most frequently deployed software includes: Apache, Netscape, NCSA, CERN, etc. Since Web+ client software is a CGI program, it’ll be installed at the cgi-bin directory of web server. So you must install a web server in advance. Remember the web server type and the cgi-bin directory of your web server, you are required to provide such information during installation.

Database

Web+ connects to most databases through ODBC, it has also provided built-in database engine. In addition to ODBC support, Web+ provides native API connectivity with three popular databases for Unix: miniSQL (or mSQL), mySQL, and PostgreSQL. If you want to use other databases, you need to install the corresponding ODBC drivers.

 

2. Installing Web+ in UNIX

It’s easy to install Web+ 4.0 in unix system. Just follow the steps below:

* Download Web+ 4.0 compressed file,

* Uncompress the file

* Login in as a root user

* Run install script

* Input required configuration

* Test your installation

 

First, download Web+. After you download Web+ 4.0, you’ll get a tar.gz file, an installation password and a License ID. Keep in mind this password and License ID, you’ll need them for your installation.

Use gzip –d Web+ 4.0 compressed file name | tar –xvf to uncompress the installation packet. Type:

gzip –d webp40solaris.tgz | tar –xvf

or

gzip –d webp40aix.tgz | tar –xvf

or

gzip –d webp40hpux.tgz | tar –xvf

or

gzip –d webp40irix.tgz | tar –xvf

or

gzip –d webp40linux.tgz | tar –xvf

After the file get uncompressed, you will see a install script file, Readme file and a webp directory.

Login in as a root user. You must be root user to install Web+4.0 before you install, otherwise your installation will fail.

Run installation script. Under the directory of uncompressed Web+ 4.0, Run:

sh INSTALL

or

./INSTALL

Input configuration information when you are prompted. After you run installation script, a welcome message will soon appear:

 

Welcome to TalentSoft Web+ Ver 4.0!!

The installation script can detect your operating system platform. Web+ 4.0 can run on Linux, Unix, HP-UX, AIX, Solaris. After that, the installation script will show the operating system platform and prompt you to input the type of web server.

 

 

Your operating system is Linux

Web+ requires a web server running.

If you have already installed Web+ before,

please make sure webpsvr is stopped before proceeding!

[a] Netscape

[b] Apache

[c] NCSA

[d] CERN

[e] Others

[f] Don't know

[quit] Quit/If you do not have a web server installed & running

Please pick the web server from the above list:

Choose your web server from the list. If you are uncertain of what type of web server you are running, choose f and the install script will attempt to determine this for you. This is not that reliable so it is recommended that you find out which server you are running prior to running the install script.

 

 

After entering the type of web server you have you will be prompted for the directory you want to install Web+ in:

 

You will now be given a series of choices which will determine

how Web+ 3.0 is installed on your system. Please answer these

accurately, or Web+ may not function properly.

At any time you may type 'quit' to abort the installation.

Destination Web+ installation directory [/webplus]:

We suggest you use the default directory which is /webplus, although if you are an experienced user you may want to use a different directory. You must then answer a series of questions about your server.

Please enter your name:

Please enter the name of your company/organization:

Please enter your Web+ License ID [ttccccrkclcccc1l1ctrrrtcr8c0lcct184c4c4xcvh}y]:

Enter the name of your SMTP server [your.server]:

Please choose a Web+ AdminPassword [admin]:

Enter the email address of the web server admin [webmaster@your.server]:

The Web Server HTML document root dir that is mapped to http://your.server/:

The Web Server CGI-BIN dir that is mapped to http://your.server/cgi-bin/:

Please enter the dir to install ODBC library(For AIX, it must be /usr/lib) [/usr/lib]:

Please enter the home dir to install the ODBC configuration file (For superuser, it must be its home dir) [/home/you]:

Please enter all of the questions about your server. If they are not correct, Web+ will not install correctly.

You will then be asked to confirm the information you have entered, and given the opportunity to change your information.

 

[1] Destination directory /webplus

[2] Your name

[3] Company/Organization

[4] License ID ttccccrkclcccc1l1ctrrrtcr8c0lcct184c4c4xcvh}y

[5] SMTP Server your.server

[6] Web+ AdminPassword admin

[7] Admin email address webmaster@your.server

[8] HTML document root dir /httpd

[9] CGI-BIN dir /httpd/cgi-bin

[10] ODBC library dir /usr/lib

[11] ODBC config dir /home/you

[quit]

Change which value? [Enter] to continue:

At this point you may change any of values you entered earlier. Read over your selections carefully and change any mistakes you might have made. Once you have verified the information is correct hit enter and the install script will install Web+. This includes moving all files to their proper locations and creating the necessary symbolic links. If you receive any error messages during setup, verify the required information with your System Administrator and try running the install script again. If the script continues to fail, refer to the HOWTO file included with the Web+ UNIX distributions for instructions on manual installation.

Web+ is now installed and configured. Changes can be made to these settings by editing the webpsvr.ini file located in the /webplus/bin directory, or by using the Web+ Server Manager via a web browser (see the section on the Server Manager for more information).

UNIX Installation Directory Tree

The installation directory tree for the various UNIX platforms looks very similar to the Windows version of Web+. The principle difference is the location of the executables. The webplus.exe files are located in your web server cgi-bin/ directory, which you specified during the install script procedures. The webplus.ini file is also located in this directory. There is a directory called ODBC that contains the libraries needed for Web+ to interface with and ODBC driver, which you will need to supply yourself. The rest of the directory structure is the same as the Windows version.

 

Verifying Installation

Before you run any example applications, please verify that Web+ is running correctly. To do this, access the following URL via your browser:

For the CGI version of Web+, type this URL:

http://localhost/cgi-bin/webplus.exe?about

For the ISAPI or NSAPI versions of Web+, type this URL:

http://localhost/cgi-bin/webplus.dll?about

For the ISAPI or NSAPI versions of Web+, type this URL:

http://localhost/cgi-bin/webplus.dll?about

For the ISAPI or NSAPI versions of Web+ with document mapping, type this URL:

http://localhost/webplus.exe?about

 

If everything is running correctly, the following "Powered By TalentSoft Web+" screen will be displayed, indicating a successful installation. This is also the easiest way to find out what version and compile number of Web+ you are running.

Upgrade Web+ Under Windows NT 4.0

  1. Go to Control Panel|Services, stop TalentSoft Web+ Server.
  2. Go to webplus | bin directory, rename webpsvr.exe and webpsvc.exe. If currently compile number is 317, it its better rename them to 317webpsvr and 317webpsvc.
  3. Put the up-to-date webpsvr.exe and webpsvc.exe files in the same directory: webplus | bin.
  4. Go back to Control Panel | Services, start TalentSoft Web+ Server.
  5. Verify upgrade is just using the same method as verifying installation above.

Custom Web+ Error Messaegs Under Windows NT 4.0

  1. Write your own error handling scripts called errormsg.wml.
  2. Put it weplus|script.
  3. Disable the custom error handling script is simply rename or delete the script, then Web+ will use default way to show error.
  4. The following is a sample errormsg.wml:

<font size=5> I found a BUG!!<br><br></font>

<webprint>

<table border=1><tr bgcolor=##dd4444><td><font color=##ffffff><b>General Error Info</b></font></td></tr>

<tr bgcolor=##ff9999><td><table border=0>

#if(parameterExists(Error.ErrorCode),"<tr><td>Error Code:</td><td><b>" & Error.ErrorCode & "</b></td></tr>","")#

#if(parameterExists(Error.ErrorComment),"<tr><td>Error Comment:</td><td><b>" & Error.ErrorComment & "</b></td></tr>","")#

#if(parameterExists(Error.ErrorTroubleshooting),"<tr><td>Error Troubleshooting:</td><td><b>" & Error.ErrorTroubleshooting & "</b></td></tr>","")#

#if(parameterExists(Error.ErrorExplanation),"<tr><td>Error Explanation:</td><td><b>" & Error.ErrorExplanation & "</b></td></tr>","")#

#if(parameterExists(Error.Script),"<tr><td>Error Script:</td><td><b>" & Error.Script & "</b></td></tr>","")#

</table></td></tr></table><br><br>

<webif #parameterExists(error.FileName)#>

<table border=1><tr bgcolor=##dd4444><td><font color=##ffffff><b>File IO Info</b></font></td></tr>

<tr bgcolor=##ff9999><td><table border=0><tr><td>Error File Name:</td><td><b>#Error.FileName#</b></td></tr></table></td></tr></table><br><br>

</webif>

<webif #parameterExists(error.VarName)#>

<table border=1><tr bgcolor=##dd4444><td><font color=##ffffff><b>Variable Info</b></font></td></tr>

<tr bgcolor=##ff9999><td><table border=0><tr><td>Error Variable Name:</td><td><b>#Error.VarName#</b></td></tr></table></td></tr></table><br><br>

</webif>

<webif #parameterExists(error.SqlErrorMsg)#>

<table border=1><tr bgcolor=##dd4444><td><font color=##ffffff><b>Database Query Info</b></font></td></tr>

<tr bgcolor=##ff9999><td><table border=0>

#if(parameterExists(Error.DataSourceName),"<tr><td>Data Source Name:</td><td><b>" & Error.DataSourceName & "</b></td></tr>","")#

#if(parameterExists(Error.QueryName),"<tr><td>DB Query Name:</td><td><b>" & Error.QueryName & "</b></td></tr>","")#

#if(parameterExists(Error.SQL),"<tr><td colspan=2>SQL statement: <ul><b>" & Error.SQL & "</b></ul></td></tr>","")#

#if(parameterExists(Error.SqlErrorMsg),"<tr><td>SQL Error Message:</td><td><b>" & Error.SqlErrorMsg & "</b></td></tr>","")#

</table></td></tr></table>

</webif>

<webif #parameterExists(error.Date)#>

<table border=1><tr bgcolor=##dd4444><td><font color=##ffffff><b>Bad Date Info</b></font></td></tr>

<tr bgcolor=##ff9999><td><table border=0><tr><td>Invalid Date:</td><td><b>#Error.Date#</b></td></tr></table></td></tr></table><br><br>

</webif>

</webprint>

<br><br>Now, <font size=+1>go fix it!</font><br><br>

<hr><br><br>

Installation Troubleshooting

"Communication Error" when trying to run scripts.

Go to Control Panel | Services and verify that the TalentSoft Web+ Service is present and running.

Verify that the browser is using the Hypertext Transfer Protocol, and not the File protocol to access the script. That is, the URL should begin with "http://" and not "file://".

Verify, via the web server’s management application (e.g., IIS’s "Server Manager"), that the logical directory /cgi-bin is mapped to a legitimate directory containing the webplus.exe file.

When you load up the page having a download screen for downloading the webplus.exe check the IIS Manager | Directories | Properties and make sure the Access is "Execute" only. (Please don't check the "Read" option).

When trying to access /cgi-bin/webplus.exe, the browser pops up a "Save As…" dialog box.

Go to the web server’s management application and find the properties for the /cgi-bin directory. Verify that the directory has "Execute" access enabled. It is also advised that the "Read" access be disabled, to prevent malicious activity.

"ODBC data source not found".

The ODBC data source hasn’t been set up correctly. To correct this, first open the webpsvr.ini file (or run the Server Manager utility), find the ODBC section and determine the name of the ODBC data source.

Then, go to Control Panel | ODBC, select "System DSN", then select "Add".

Now choose the type of database that is being used, give the data source the same name as was found in the webpsvr.ini file and "Select" the location of the database, if applicable (e.g., with MS Access databases).

Finally, restart the TalentSoft Web+ Service by going to Control Panel | Services, stopping the service, and then starting it.

 

 

Chapter 6

Database Processing

One of the most powerful features of Web+ is its ability to communicate with ODBC databases.

What is ODBC?

ODBC was introduced to solve the problem of linking the operating system with any sort of database from any vendor on any platform. ODBC is implemented through a set multiple DLLs. The ODBC Driver Manager contains the ODBC API functions. When you call these functions, the driver manager calls upon a database-specific driver DLL to execute database operations. If the DLL manipulates the files directly, it called a single-tier driver. If the DLL calls a database engine to manipulate the files, it is called a multiple-tier driver.

The ODBC Control Panel lets you add, delete, and edit data sources. A data source is created by choosing a driver and supplying the name and another parameter indicating how to access the database information. Once you've configured your data source, test it with an ODBC client application such as Access (using the Attach Table menu option) or Microsoft Query. If you can't get to your data, double check that the configuration of the data source is correct and that you're entering your user name and password correctly. If you're still having trouble, contact your database administrator or database driver’s vendor.

What is a Data Source?

ODBC applications do not connect to databases by naming the appropriate driver. Instead, they name a data source. The ODBC standard requires that a data source be created before a database can be accessed. A data source is a logical name, or handle for the associated database. Programs that use ODBC to connect to databases refer to them by their data source name. This is how Web+ integrates with databases.

What is SQL?

SQL (which stands for Structured Query Language) is the standard language with which programs communicate with databases. It consist of a few regular English words that tell the database what kind of query it wants to make. For example, "SELECT Name, Phone FROM Users" would select all of data in the "Name" and "Phone" fields from the "Users" table. See the section on SQL Statements in the appendix for a summary of SQL commands.

 

Setting up ODBC Data Sources

Instructions for setting up ODBC on a UNIX sytem are located in /webplus/ODBC/HOWTO.

The two basic steps required to set up an ODBC compliant database with Web+ are to first create an ODBC datasource for the database, then to configure Web+ to recognize the database. To protect data sources against unauthorized access by scripts, Web+ will not connect to a datasource it has not been configured to recognize.

Creating an ODBC Data Source

Open the ODBC Data Source Administrator (via Control Panel | ODBC) and select the "System DSN" tab.

Click "Add…" and a list of ODBC drivers will be presented.

Highlight the type of datasource you intend to set up, then click "Finish".

Depending on the type of driver you selected, a Setup screen will appear. For MS Access databases, you need to add at least a data source name (this is the name that Web+ will use to refer to the data source) and then click "Select…" to locate the physical database file.

Once you’ve located the file, click "OK", then click "OK" at the Setup screen. Now your data source will be added to the list of system data sources. Click "Close" twice and the data source will be added.

Configuring an ODBC Data Source for Web+

ODBC Data sources can be configured for Web+ in two ways. One way is to modify the webpsvr.ini and manually add the information. The more convenient method is to use the Web+ Server Manager, which will automatically modify and update the webpsvr.ini file.

Launch the Web+ Server Manager (webplus.exe?script=/WebPlus/admin/admin.wml) and log in using the Admin Password.

 

 

 

Select the "Datasources" button to view the data source configuration page.

 

 

 

 

 

 

 

Note: The above two are from the same window

 

Remarks: Once a data source has been entered via the Web+ Server Manager, it cannot be changed. It must either be deleted and re-created, or manually edited in the webpsvr.ini file.

 

 

Chapter 7

Web+ Administration

Overview

Web+ provides a set of configuration options for the system administrator to control a wide variety of features such as the performance log, debugging log level, ODBC data sources, File I/O securities and SMTP email connection. There are two ways to change the configuration of Web+. One way is to modify the configuration files directly using a text editor, the other way is by using the Web+ Server Manager via a web browser.

Using the Web+ Server Manager

The Web+ Server Manager is a set of scripts written in Web+ which are designed to simplify the management of Web+, both locally and from a remote web browser. With the default script directory, the Server Manager may be accessed through the following URL:

http://localhost/cgi-bin/webplus.exe?script=admin/admin.wml

Several safeguards exist to prevent unauthorized people from running the Server Manager:

The Server Manager consists of eight screens of configuration information corresponding to the eight sections in the webpsvr.ini file. The settings can be configured on each screen by first making the desired change and then clicking the "Apply" button at the bottom of the page.

 

[Admin] Administration Options

This page contains the general Administration settings for Web+.

Parameter

Function

Require Administration Password

If this is turned off, then no administration password is required to access the server manager.

Remote Administration Password

The password required to access the Server Manager and to the issue the <webIniRefresh> command from a Web+ script.

Enable Remote Admin

Enables or disables the Server Manager. If this is set to No, then the server manager will not run. To reset this value, the webpsvr.ini file must be modified manually to set AllowRemoteAdmin=1.

Remote Administration IP

Restricts remote Administration to just those IPs indicated. This value can be a specific IP (198.36.217.45), or a set of IPs (198.36.217).

Administrator Time Out

The time that specifies how long an administrator may sit idle in the server manager before they must re-login.

Socket Time Out

The general time out value (in seconds) for all socket activity, unless a specific time out value is indicated for that socket call.

Thread Time Out

The time out value (in seconds) for all Web+ looping commands. If a webWhile or webFor gets stuck in an infinite loop, Web+ will terminate the thread after the specified time-out.

Admin E-mail Address

The Web+ Administrator e-mail address. All errors generated by Web+ and all mail directed to Web+ Administrator will be sent to this e-mail address.

Comment Style

Specifies which style of comments to use.

Send HTTP OK

If enabled, Web+ will send the "HTTP/1.0 200 OK" sequence to the web server.

[Main] Main Options

The Main section of the Server Manager contains information relative to the licensing and installation of Web+.

Parameter

Function

License User Name

The name of whom Web+ is registered to.

License Company Name

The company that Web+ is registered to.

Web Plus URL

The path and file name for the webplus.exe file.

Enable Crystal Report

Toggles whether or not Crystal Reports can be generated with Web+.

Web+ Server Password*

The password Web+ uses to communicate between the client and the server.

Web+ Server Port*

The TCP/IP socket port used to communicate between the client and the server.

These items are for reference only. To change these items, change both the keys in the [Main] section of the webpsvr.ini file and the webplus.ini file. If these values are different, Web+ will return a communication error.

 

[Template] Setting Script Paths

What are Script Root Directories?

Web+ allows the administrator to control which directories can contain Web+ scripts by designating certain directories as script root directories. Web+ can execute a script only if it is in a script root or a subdirectory of a script root. Your server must have at least one script root directory.

Physical and Logical Paths

To Web+, each script root has a physical path and a logical path name. The physical path is the actual location of the directory on the Web+ server. The logical path name is the name by which users refer to the script root.

Setting up Script Root Directories

To identify a directory on your server as a script root, go to the Script Options page of Server Manager and find the section at the bottom labeled "Add New Script." Enter the full path of your directory in the "Physical Path" box, and choose a logical path name to enter in the "Logical Path" box. Hit the "Set Configuration" button to save the new information.

For example, suppose you have written a script file called "c:/WebPlus/scripts/MyScript.wml". You could enter "c:\WebPlus\scripts\" as a physical path and "MyStuff" as a logical path name. Then the logical name of the script would be "/MyStuff/MyScript.wml", and you could execute your script by accessing the URL "webplus.exe?script=/MyStuff/MyScript.wml".

To edit information about a script root, make the desired changes and choose the "Set Configuration" button. To remove a directory’s designation as a script root, select the "Delete" button appearing beside the template.

Parameter

Function

Script File Extension

This is the default extension for Web+ script files. It is nearly always ".WML".

Logical Path

The logical path for a script directory.

Physical Path

The physical path for the corresponding logical path.

There can be any number of logical and physical path combinations for script files. Additional pairs can be added by entering the appropriate information into the blank fields at the bottom of the screen.

 

[Log] Managing the Error Log

This section pertains to the error log that Web+ keeps through normal operation.

Parameter

Function

Log File Path

The path to the directory that contains the webplus log file.

Log Level

The degree of logging that Web+ does. A level of 0 will provide no logging, but the best performance of Web+; whereas a level of 3 will log everything, but provide the slowest Web+ performance.

Log File

Whether the log file is appended or overwritten when Web+ begins.

Email Errors to Admin

If this is selected, then Web+ errors will be emailed to the Admin when one occurs.

Echo IP

Echoed variables will only be echoed to systems at this class of IP addresses.

Variable Echo

When one of the checkboxes in this subsection is marked, all variables associated with that selection will be echoed to the browser when the script is executed.

Performance Time Echo

When one of these selections is checked, the amount of time required to perform the indicated task will be displayed to the browser.

[Mail] Setting SMTP Mail Configuration

This section contains all of the configuration settings for Web+ SMTP Mail.

Parameter

Function

SMTP Server Name

The server used as the SMTP mail server.

SMTP Port Name

The SMTP mail port. This is almost always 25.

Mail Spool Path

The directory that spooled mail will be put into. Spooled mail is mail waiting to be sent.

Mail Log Path

The directory that logged mail will be put into.

Mail Error Path

The directory that mail with errors will be put into. Consult the webplus error log for more information on mail that ends up in this directory.

Number of Send Mail Attempts

The number of times Web+ will try to send SMTP mail before giving up.

[ODBC] Administering ODBC Data Sources

There can be any number of ODBC data sources with Web+. New data sources can be created by entering the appropriate information into the blank fields at the bottom of the page.

Parameter

Function

Data Source Name

The Data Source Name assigned to the data source when it was created in the ODBC section of the Control Panel.

UserID and Password

Specifies the User ID and Password if they are required to access this data source.

SQL Permissions

The list of permissions for the data source: Select, Insert, Update, Delete, SP (Stored Procedures).

 

[File I/O] Setting File I/O Paths and Permissions

There can be any number of File I/O logical and physical path combinations. New combinations can be created by entering the appropriate information into the space at the bottom of the page.

Parameter

Function

Logical Path

A logical path. Web+ will only allow access to files located in a logical directory, or a sub-directory of a logical directory.

Physical Path

The corresponding physical path.

Read / Write

This indicates whether this file can be read from and/or written to.

Read Password

The password required to read from a file in the corresponding physical path.

Write Password

The password required to write to a file in the corresponding physical path.

[webRun] Controlling Execution of External Files

This section contains configuration for the <webRun> command.

Parameter

Function

Enable webRun Command

Indicates whether the webRun command will function. If it is disabled, then no webRun command will work.

webRun Password

Any webRun command issued must have this password. If no password is specified, none is required. Warning: allowing scripts to run executable files presents a security risk and must be done carefully.

Enable webDLL Command

Indicates whether the webDLL command will function. If it is disabled, then no webDLL command will work.

WebDLL Password

Any webDLL command issued must have this password. If no password is specified, none is required. Warning: allowing scripts to execute DLLs presents a security risk and must be done carefully.

 

Modifying the Web+ Configuration Files Directly

Because of the client/server structure of Web+, there are two Web+ configuration files: webplus.ini and webpsvr.ini. The former (webplus.ini) is the configuration file for the Web+ client (webplus.exe or webplus.dll). The latter (webpsvr.ini) is the configuration file for the Web+ Server (webpsvr.exe or webpsvc.exe). For Windows installations, these two files are installed in the default Windows directory (e.g., c:\windows\ or c:\winnt\). These files also exist in the c:\webplus\bin\backup directory, but are never used except as backups. The active configuration files (webplus.ini and webpsvr.ini) are always in the Windows directory. Do not confuse these two directories: the ones in the \webplus\bin\backup directory are for reference and backup purposes only; the ones in the Windows directory are the active Web+ configuration files.

The contents or the Web+ configuration files can be found in the Appendix.

Web+ Client/Server Port and Password

In order for the Web+ client and server to communicate, they must know which port is being used and each must know the Web+ server password. The default Web+ port is 6888 and the default Web+ server password is "webplus". One or both of these settings can be changed, but the values in both the webplus.ini and the webpsvr.ini files must be identical.

For both the client and server configuration files (webplus.ini and webpsvr.ini) the key names are the same and they are both in the Main section.

[Main]

WebpServerPort=6888

WebpServerPassword=webplus

Individual Script Access Control

Web+ has the ability to restrict access to certain specified scripts. The accesses that can be restricted are: File Read, File Write, Database Connectivity, External Execution (webRun) and SMTP. A script that has its access restricted is referred to as an untrusted script. In the Template section of the server configuration file (webpsvr.ini) there exists a key called "NumUntrustedScripts". This is set to the total number of untrusted scripts. If you need to add an untrusted script, be sure to increment this value. For each untrusted script, there are two parameters: UntrustedScriptN and UntrustedScriptAllowOnlyN. The first parameter refers to the logical path and name of the script, and the second specifies which functions the script cannot, under any circumstances, perform. The "N" at the end of each parameter represents an integer corresponding to the number of the untrusted script. The first untrusted script would have the parameters UntrustedScript1 and UntrustedScriptAllowOnly1. Adding values corresponding to the allowed functions as defined here generates the value set for UntrustedScriptAllowOnly:

Value

Function

1

File Read

2

File Write

4

Database Connectivity

8

External Execution (webRun)

16

SMTP (webMail)

For instance, if a script were to be able to do everything except External Execution, then the UntrustedScriptAllowOnly value would be set to 23 (1 + 2 + 4 + 16). A value of 31 for this variable means that the script may do everything normally. Note: untrusted scripts that perform allowed functions still have to supply the regular applicable passwords.

[Template]

NumUntrustedScripts=1

UntrustedScript1=/webplus/admin/admin.wml

UntrustedScriptAllowOnly1=15

 

Section 3

Programming with Web+

This section of the Web+ User’s Guide deals with the programming aspect of Web+. It will contain examples on writing Web+ scripts and details on many of the Web+ commands and functions. For a complete listing of Web+ commands and functions, see the TalentSoft Web+ Language Reference.

 

 

Chapter 8

Hello, World - Writing Scripts

Web+ scripts are HTML scripts with a few additional commands and functions. These additional commands and functions are referred to as the Web+ Markup Language. These files are differentiated from regular .HTML files by their .WML file extension.

Each user who runs Web+ supplies the name of a script, which is a file on your server containing Web+ instructions. Web+ reads the contents of the file, executes the commands in the file, and returns the result as output. The Web+ commands in the script can instruct Web+ to retrieve information from databases, perform mathematical computations, and do many other things.

Basic Process

The basic process for creating Web+ scripts is comprised of three parts. First, you must create the file itself, which can be done with any ordinary text editor. Next, the script must be saved somewhere that Web+ can access it. Finally, the browser must be able to display the file correctly.

Creating the Script

A Web+ script does not need to contain any special Web+ tags or commands, so any hypertext file can be used as a Web+ script. For instance, create a new file with any text editor and type in this text:

<html>

<head>

<title>Hello, World</title>

</head>

<body>

<h1>Hello, World!</h1>

</body>

</html>

Saving the Script

Web+ allows the administrator to control which directories can contain Web+ scripts by designating certain directories as script root directories. Web+ can only execute scripts which reside somewhere within the script root directory. When Web+ is first installed, the default script root directory is: "c:\WebPlus\script\". Save the example script to the default script root directory as "hello.wml".

Referencing the Script

Web+ scripts are viewed by having the Web browser execute Web+ and passing it the name of the script that you want to run. To tell Web+ which script to run, type the name of the script, using its logical path name, in the URL when you call Web+.

http://myDomainName/cgi-bin/webplus.exe?script=/hello.wml

Web+ will then execute the script, parse any Web+ commands and send to final output to the browser to be displayed. Since there are no Web+ tags in hello.wml, Web+ merely passes the entire file along to the browser for output to the end user.

Checking the Syntax

Once a script has been written, its Web+ syntax can be checked without having to execute the script. This is done with the "CheckScript" parameter of Web+. If works just like the "Script=" parameter, but instead of executing the script, Web+ will merely report the number, and type of errors found. To check the syntax of the hello.wml script, issue this command:

http://myDomainName/cgi-bin/webplus.exe?CheckScript=/hello.wml

Web+ should report back: Congratulations! 0 errors found.

 

Web+ Naming and Coding Convention

Because Web+ works on multipaltforms, like on UNIX is case sensitive.

  1. Using low case is a must for all the path name, variable names;
  2. Web+ Tags and Functions follow the following examples:
  3. webMail, webPopOpen, webFor, webLocation

    ClientVarList, ParameterExistes, ListCount;

  4. Use Webplus not Web+!
  5. For all the Webplus developers put as much comments as you could, this will make Webplus code more readable;
  6. Readme file is a must for Webplus applications.

 

How to write Cross Platform Web+ Script

Webplus is used in multiplatforms, so it is better to understand following:

<!--- <webif #lcase(webpSvrPlatform) !? "win"#>--->

<!--- TO determine whether it is an NT Service version. --->

<!--- If the ServerOS version >= 10 (which means NOT NT/95--->

<webif #(left(webGetVersion("ServerOS"),2) gte 10 )#>

 

<webPrint>

#webGetVersion("ServerOS")# <BR>

<BR>

#webGetVersion("Type")#

<BR>

#left(webGetVersion("ServerOS"),2) #

<BR>

#left(webGetVersion("Type"), 1)#

</webPrint>

 

<!--- TO determine whether it is an NT Service version. If so, display the "Restart Web+ Service " button --->

<!--- If the ServerOS version < 5 (which means NT, and ServiceType = 1 --->

<webif #(left(webGetVersion("ServerOS"),2) lt 5 ) and (left(webGetVersion("Type"), 1) = 1 )#>

This is NT Service version of Web+

</webif>

==========================================================================

Latest (98/2/18) Operating System Code, 2 digit

Value Description

00 Shareware license (OS Unknown)

01 Windows NT (i386)

02 Windows NT (Alpha)

03 Windows NT (MIPS)

04 Windows NT (Power PC)

09 Windows 95

10 Linux (General)

11 Linux (x86)

12 Linux (Sparc)

20 Sun Solaris (General)

21 Sun Solaris (Sparc)

22 Sun Solaris (x86)

30 HP-UX

40 IBM AIX

50 SGI IRIX

60 Digital Unix

70 SCO Unix

80 BSD Unix

 

 

 

Chapter 9

Using the Web+ Markup Language

Web+ uses the Web+ Markup Language to execute commands and call functions. The Web+ Markup Language looks and behaves identically to the HyperText Markup Language. It consists of several tags, some of which stand alone (e.g., the Horizontal Rule HTML tag is a stand alone: "<hr>") and some that are containers (e.g., the Bold HTML tag is a container: "<b> … </b>"). Throughout this User's Guide, all Web+ tags (statements) and functions included in examples will be in bold. Parameters and variables for these statements and functions will be italicized.

Commands and Statement Tags

These are the root of Web+. Web+ command tags are inserted like regular HTML command tags. The simplest of these is the <webBeep> command. The only thing it does is to cause the Web+ server computer to emit a beep noise.

Example

This will make the Web+ server beep.

<webBeep>

Some Web+ command tags are containers. The <webPrint> tag is the most common Web+ container tag. For each opening <webPrint> tag, there must exist a closing </webPrint> tag. If there is not a matching closing tag for any Web+ container, then output will be truncated at the point just before the opening Web+ tag.

Example

<webPrint>

The value of x is: #x#.

</webPrint>

Variables

A Web+ variable can contain a single character, a string of characters, a number or an array of values. Variables and variable expressions must be enclosed in pound signs ("# … #") when being used by Web+. This is how Web+ differentiates variables and expressions from regular HTML text.

String variables are of variable length (up to approximately 16,000 characters long) and must be enclosed within a pair of double quotes (" … "). A numeric variable can be any real number (positive or negative, integer or floating point) and can have up to twelve decimal places (1.0E-12). Numeric variables need not be enclosed in double quotes, but may be. Array variables are lists of regular variables.

Setting the Value of a Variable

To set the value of a variable, use the <webSet> tag:

<webSet #n# = 7>

<webSet #name# = "John Smith">

<webSet #m# = #n#>

<webSet #n# = #3 * n + 1#>

The <webSet> tag assigns the variable name enclosed in pound signs to the value that appears to the right of the equals sign. The value can be a numeric value, a string value, another variable name, or any expression. If the value is a variable or an expression, then it should be enclosed in pound signs, as in the last two examples above.

String Lists

A string list is a list of elements contained in a regular string variable. A string list starts with a delimiter character and is followed by each element. The delimiter is the character that separates the elements from one another in the string. Therefore, no list element may contain the character defined as the delimiter. For example, a string list of last names with a comma delimiter would look like this:

",Johnson,Hazwoper,Schoolmeester,Smith"

A forward slash is another common delimiter character. The same string list with a forward slash delimiter would look like this:

"/Johnson/Hazwoper/Schoolmeester/Smith"

There are some functions designed to facilitate working with string lists. They are described in a later section.

Arrays

An array variable is a list of variables with the same name. Separate values within an array are distinguished from one another by using an index. Arrays in Web+ are dynamic; this means that they do not have to have their maximum index value predefined. For example, the names of three array variables could be name[1], name[2] and name[3]. Each variable has the same name (‘name’), but they are distinguished from one another by their index values (1, 2 and 3).

An individual element of an array can be manipulated like a regular variable. For instance, you can set the value of just one array variable with a simple <webSet> tag.

<webSet #a[2]# = 7>

<webSet #a[2]# = "Second">

<webSet #a[2]# = #a[1] + 5#>

The values of several array values can also be set at once. This is done be using <webSet> to set an array to a string list. Each element of the string list will be inserted into the corresponding index of the element.

For example, suppose you want to create an array called "a" where a[0] = 1, a[1] = "Web+" and a[5] = 17. First, create a string list using a comma as a delimiter.

",1,Web+,,,,17"

Then set the array equal to this string list.

<webSet #a[]# = ",1,Web+,,,,17">

Note that this example will set a[2], a[3], and a[4] to empty strings ("").

String Lists vs. Arrays

Both string lists and arrays have their merits, but sometimes one convention is more appropriate in some instances than the other. Arrays are superior if you are doing operations on undefined indexes of the array. For example, changing the ninth element of an array is easy, but modifying the ninth element of a string list requires a great deal of string processing. However, arrays can't be sent via forms, but string variables can. Since string lists are essentially just string variables, they can be sent via forms without any problem.

Printing the Value of a Variable

To print the value of a variable, type the variable name, enclosed in pound signs, inside the <webPrint>… </webPrint> container tags.

<webPrint>

The value of n is #n#.

My name is #name#.

The product of m and n is #m * n#.

</webPrint>

 

Any time Web+ encounters a pound-delimited expression inside the <webPrint>… </webPrint> tag, it evaluates the expression and substitutes the value for the expression. So the above example will return the following text:

The value of n is 22.

My name is John Smith.

The product of m and n is 154.

Functions

Web+ functions typically take other variables as parameters and return a value, but some functions will take no arguments. All functions return some value, though many functions only return 1 if successful, or 0 if not. When a function is used, it is used as an expression, and must be enclosed in pound signs.

Example

<webSet #pi# = 3.141592>

<webPrint>

The absolute value of -5 is: #Abs (-5)#.<br>

The length of the string "TalentSoft" is: #Len ("TalentSoft")#.<br>

Pi, rounded to the nearest integer is: #Int (pi + .5)#.<br>

The time is: #CurrentTime ()#.

</webPrint>

Web+ Output:

The absolute value of -5 is: 5.

The length of the string "TalentSoft" is: 10.

Pi, rounded to the nearest integer is: 3.

The time is: 15:22:10.

Web+ does not offer user definable functions in the usual sense of creating functions. However, if you have a common section of Web+ code that will used repeatedly, you can create a separate .WML file with this code, and use the <webInclude> tag to include it at the appropriate times. Remember that all Web+ variables are global. Variables modified by code included with a <webInclude> will be modified globally.

The <webPrint> Tag

The <webPrint> tag, in its simplest form, is what allows Web+ to display variables and expressions. This has already been demonstrated by issuing a <webPrint> command, typing regular text mixed with Web+ expressions (enclosed in pound signs) and finally, issuing the closing </webPrint> command. But <webPrint> can do a number of other things.

<webPrint Query=QueryName Group=GroupName>

By setting the Query and Group parameters, you can cause <webPrint> to act as a loop, looping once for each row returned by the query and groups pre-defined by a <webDbQuery> tag. See the section on Databases for more information.

<webPrint File="FileName" [HTMLFormat=On|Off] [PreFormat=On|Off] [BinaryFile]>

Web+ will search each of the logical paths specified in the File I/O section of the webpsvr.ini file, looking for the file specified with the File parameter (which must be enclosed in double quotes). If it is found, it will be sent to the browser. You can manipulate how this file is displayed with the HTMLFormat and PreFormat parameters. If HTMLFormat is set to "On", then the file will be converted to HTML Format. This means that all end of line characters will be converted to <br> tags, and special characters will be changed (e.g., greater than and less than signs become "&gt;" and "&lt;" respectively). The default setting for HTMLFormat is "On". If it is set to "Off", then no such conversion takes place. If PreFormat is set to "On", then Web+ will automatically insert <pre> tags around the file to preserve character spacing and end of line markings. The default setting for PreFormat is "Off", which indicates that nothing be added. Finally, if the file being displayed is a binary file, you can inform Web+ of this by setting the BinaryFile parmeter. If Web+ encounters this, it won’t make any format the file at all, and output it to the browser, character for character.

Example

This is the hello script:<br>

<webPrint File="/hello.wml"></webPrint>

Web+ Output:

This is the hello script:

<html>

<head>

<title>Hello, World</title>

</head>

<body>

<h1>Hello, World!</h1>

</body>

</html>

Comments

HTML uses a double dash comment ("<!-- … -->") to allow programmers to include comments in their code. Comments aren’t displayed to end users, but can be seen if the end user chooses to view the HTML source. Web+ uses a triple dash comment ("<!--- … --->") to allow for code documentation. Anything inside of a triple dash comment is removed by Web+ before being sent to the browser; therefore, sections of code that have been commented out will not be sent to the browser. However, Web+ code which is contained in double dash comments will still be parsed and executed. In order to prevent Web+ code from being executed, it must be contained in a triple dash comment.

Example

<webSet #a# = 4>

<!-- <webSet #a# = 5> -->

<!--- <webSet #a# = 6> --->

<webPrint>

a = #a#

</webPrint>

Web+ Output:

a = 5

Old-Style Comments

You can also configure Web+ to use the double dash comment convention for backwards compatibility. There is a key/value pair in the webpsvr.ini file which configures the way Web+ deals with comments.

[Admin]

CommentsUseTwoDashes=0

The default is CommentsUseTwoDashes=0, which means that Web+ uses the triple dash comment code as illustrated. If CommetsUseTwoDashes=1, then Web+ will strip out everything inside double dash comments.

Example

If CommentsUseTwoDashes=1, then this script will perform as follows.

<webSet #a# = 4>

<!-- <webSet #a# = 5> -->

<!--- <webSet #a# = 6> --->

<webPrint>

a = #a#

</webPrint>

Web+ Output:

a = 4

 

Chapter 10

Manipulating Variables in a Script

Math Operators and Functions

The mathematical operators provided by Web+ are addition (+), subtraction (-), multiplication (*), division (/), exponentiation (^), and modulation (%). The expression "m mod n" indicates the remainder when m is divided by n.

<webSet #n# = #1 + 2 * 3 ^ 4#>

Web+ also provides several math functions that can be used in expressions.

Math Functions

Function

Returns

Abs (x)

The absolute value of x

Int (x)

The greatest integer less than or equal to x

Rnd (n)

A random number between 0 and 1 with n decimal places

Exp (n)

e^n

Log (Value, [Base])

The logarithmic value of Value at Base. The default Base is e.

 

Example

<webPrint>

((9 + 15) / (3 * 4)) ^ 8 = #((9 + 15) / (3 * 4)) ^ 8#<br>

Abs (-3) = #Abs (-3)#<br>

Int (4.6) = #Int (4.6)#<br>

Rnd (5) = #Rnd (5)#<br>

Exp (1) = #Exp (1)#<br>

Log (10, 10) = #Log (10)#<br>

Log (Exp (1)) = #Log (Exp (1))#<br>

</webPrint>

Web+ Output:

((9 + 15) / (3 * 4)) ^ 8 = 256

Abs (-3) = 3

Int (4.6) = 4

Rnd (5) = 0.81198

Exp (1) = 2.71828182846

Log (10, 10) = 2.30258509299

Log (Exp (1)) = 1

 

String Operators and Functions

The string concatenation operator ("&") is used to join two strings together. If either operand is a number, it converts it into a string.

<webSet #FirstName# = "John">

<webSet #LastName# = "Smith">

<webSet #FullName# = #FirstName & " " & LastName#>

Web+ also offers several string processing and formatting functions.

String Processing Functions

Function

Returns

Asc (str)

The ASCII value of the first character of str.

Chr (n)

The character associated with ASCII value n.

LCase (str)

str with all letters converted to upper case.

RCase (str)

str with all letters converted to lower case.

Trim (str)

str with all leading and trailing spaces trimmed off.

LTrim (str)

str with all leading spaces trimmed off.

RTrim (str)

str with all trailing spaces trimmed off.

Len (str)

The length of str.

Left (str, n)

The leftmost n characters of str.

Right (str, n)

The rightmost n characters of str.

Mid (str, n)

The rest of str, starting at n.

Mid (str, n, m)

The next m characters of str, starting at n.

InStr (str1, str2)

The character position at which str2 is first found in str1.

InStr (n, str1, str2)

The character position at which str2 is first found in str1, starting at location n.

InStr (n, str1, str2, 1)

The character position at which str2 is first found in str1, ignoring case and starting at location n.

StrReplace (str, str1, str2)

str with each occurrence of str1 replaced with str2.

String Formatting Functions

Function

Returns "str"

NumberFormat (str)

With commas.

DecimalFormat (str)

With commas and two decimal places.

DollarFormat (str)

With commas, two decimal places and a dollar sign.

YesNoFormat (str)

As "Yes" or "No".

ParagraphFormat (str)

With all single CR/LFs with spaces and all double CR/LFs with <P> tags.

StripCR (str)

Strips CRs.

HTMLEditFormat (str)

Strips CRs and escapes all special characters.

HTMLCodeFormat (str)

Strips CRs, escapes special characters and adds the <PRE> … </PRE> tag.

PreserveSingleQuotes (str)

Preserves single quotes (') for use in SQL statements.

URLEncodedFormat (str)

Converts spaces to "+" signs and replaces special characters with escape codes.

Format (str, method)

Formatted with a predefined or user defined format method (see below).

Predefined Format Methods

Format Method

Purpose

General Number

Displays number as it is, without any change.

Currency

Adds commas, dollar sign and parentheses for negative values.

Fixed

At least one digit to the left, and two to the right of the decimal place.

Standard

Adds commas and displays only two decimal places.

Percent

Multiplies the number by 100, adds a percentage sign and displays two decimal places.

Scientific

Scientific notation with one digit to the left, and two to the right of the decimal place.

Yes/No

Displays "Yes" or "No".

True/False

Displays "True" or "False".

On/Off

Displays "On" or "Off".

User Defined Format Methods

Format Character

Meaning

Description

0

Digit Placeholder

Displays a digit, or a zero if there is no digit.

?

Digit Placeholder

Displays a digit, or nothing if there is no digit.

. (period)

Decimal Placeholder

Decimal point reference mark.

%

Percentage Placeholder

The expression is multiplied by 100 and a percentage sign is inserted where indicated.

, (comma)

Thousand Separator

Indicates that the number should use thousands separators.

Example

<webPrint>

Asc ("+") = #Asc ("+")#<br>

Chr (87) = #Chr (87)#<br>

Ucase ("TalentSoft") = #Ucase ("TalentSoft")#<br>

Mid ("TalentSoft", 6, 3) = #Mid ("TalentSoft", 6, 3)#<br>

InStr ("TalentSoft", "t") = #InStr ("TalentSoft", "t")#<br>

InStr (1, "TalentSoft", "t", 1) = #InStr (1, "TalentSoft", "t", 1)#<br>

StrReplace ("Web+", "+", "Plus") = #StrReplace ("Web+", "+", "Plus")#<br>

Format (123456.789, "0??.??0") = #Format (123456.789, "0??.??0")#<br>

Format (123456.789, "$?,???.00") = #Format (123456.789, "$?,???.00")#<br>

</webPrint>

Web+ Output:

Asc ("+") = 43

Chr (87) = W

Ucase ("TalentSoft") = TALENTSOFT

Mid ("TalentSoft", 6, 3) = tSo

InStr ("TalentSoft", "t") = 6

InStr (1, "TalentSoft", "t", 1) = 1

StrReplace ("Web+", "+", "Plus") = WebPlus

Format (123456.789, "0??.??0") = 123456.789

Format (123456.789, "$?,???.00") = $123,456.79

Example

<webSet #n# = -1234567.9>

<webPrint>

General Number = #format (n, "General Number")#<br>

Currency = #format (n, "Currency")#<br>

Fixed = #format (n, "Fixed")#<br>

Standard = #format (n, "Standard")#<br>

Percent = #format (n, "Percent")#<br>

Scientific = #format (n, "Scientific")#<br>

Yes/No = #format (n, "Yes/No")#<br>

</webPrint>

Web+ Output:

General Number = -1234567.9

Currency = $(-1,234,567.90)

Fixed = -1234567.90

Standard = -1,234,567.90

Percent = -123456790.00%

Scientific = -1.20E+06

Yes/No = Yes

 

Comparison Operators

Here are the comparison operators, which can be used to compare strings or numbers:

Operator

Meaning

eq =

equal to

ne !=

not equal to

eq$ =$

(non-case-sensitive) equal to

ne$ !=$

(non-case-sensitive) not equal to

lt

less than

lte

less than or equal to

gt

greater than

gte

greater than or equal to

?

contains (case-sensitive)

!?

does not contain

Each comparison operator returns either 0 or 1 depending on whether the condition is true or false. Web+ makes no distinction between a number and the string representing the decimal expression of the number.

Examples

Expression

Value

3 eq 6

0

3 eq "3"

1

"webplus" eq "WebPlus"

0

"webplus" eq$ "WebPlus"

1

"WebPlus" ? "Plus"

1

"Plus" ? "WebPlus"

0

 

Logical Operators

The logical operators that Web+ uses are AND, OR and NOT. Web+ recognizes both the words "and", "or" & "not" and the corresponding symbols "&&", "||" & "!". All non-zero expressions are considered to be "True" and all zero expressions are considered "False". Each logical operation returns either 1 or 0.

Examples

Logical Expression

Identical To

Resultant

1 AND 2

1 && 2

1

0 AND 1

0 && 1

0

3 OR 0

3 || 0

1

NOT 0

!0

1

NOT 1 AND 2

!1 && 2

0

-4 OR 0 OR NOT 2

-4 || 0 || !2

1

3 OR 0 AND NOT 0

3 || 0 && !0

1

Note: in the order of precedence for logical operators, "NOT" has the highest, then "AND" and finally "OR".

 

Precedence

When several operations occur in an expression, each part is evaluated and resolved in a predetermined order. That order is known as the operator precedence. Parentheses can be used to override the order of precedence and force some parts of an expression to be evaluated before others. Operations within parentheses are always performed before those outside. Within parentheses, however, normal operator precedence is maintained. For multiple operations with equal precedence, the expression is evaluated from left to right.

When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last. Within individual categories, operators are evaluated in the order of precedence shown below, highest levels first:

Operator

Description

Type

-

Negation

Arithmetic

^

Exponentiation

Arithmetic

* /

Multiplication and Division

Arithmetic

%

Modulo

Arithmetic

+ -

Addition and Subtraction

Arithmetic

&

String Concatenation

String

= eq

Equal To

Comparison

!= ne

Not Equal To

Comparison

lt

Less Than, <

Comparison

gt

Greater Than, >

Comparison

Lte

Less Than or Equal To, <=

Comparison

Gte

Greater Than or Equal To, >=

Comparison

? Contain Contains

Contains

Comparison

!? NotContain

Does Not Contain

Comparison

! Not

Not

Logical

&& And

And

Logical

|| Or

Or

Logical

All Comparison Operators have the same precedence and always evaluated left to right.

 

Chapter 11

Controlling the Flow of Execution in a Script

Web+ allows you to control the flow of execution in your scripts with several tags.

Conditional Statement Tags

Conditional flow control tags are used to control the order in which commands in a script are executed.

The <webIf> Tag

The <webIf> command executes a block of code based on the result of an expression. If the conditional is true, the statement block following the <webIf> (but before the </webIf>) is executed. The conditional expression can consist of any number of comparison and logical operators.

The commands <webElseIf> and <webElse> can also be used for further branching control If the conditional expression in <webIf> is false, then the conditional expression in the <webElseIf> is evaluated. If it is found to be true, that statement block is executed. There can be any number of <webElseIf> tags. If the <webIf> conditional expression is false, and all <webElseIf> conditional expressions are also false, then the statement block following the <webElse> tag is executed.

The <webIf> tag requires a closing </webIf> tag. If <webIf> tags are nested within one another, be sure the closing </webIf> tags correspond to the correct <webIf> tags. If there is no closing </webIf> tag, then Web+ will not execute any of the script following the initial, unclosed <webIf>.

<webIf #condition#>

[statement-block]

<webElseIf #condition#>

[statement-block]

<webElse>

[statement-block]

</webIf>

Example:

<webIf #I lt 10#>

<webPrint>#I# is less than 10.</webPrint>

<webElseIf #I = 10#>

<webPrint>#I# is equal to 10.</webPrint>

<webElse>

<webPrint>#I# is greater than 10.</webPrint>

</webIf>

The < webSelectCase > Tag

The <webSelectCase> tag allows a script to branch to several different statement-blocks depending on the value of one expression. The test expression is evaluated and compared with the expression in each of the subsequent <webCase> tags. If both expressions match, then the statement block following the corresponding <webCase> tag is executed. If no matching expression is found, and a <webCaseElse> tag exists, the statement block following it will be executed. Otherwise, no statement block within the <webSelectCase> and the </webSelectCase> tags will be executed.

The <webSelectCase> tag requires a closing </webSelectCase> tag. If <webSelectCase> tags are nested, be sure the closing </webSelectCase> tags correspond to the correct <webSelectCase> tags. If there is no </webSelectCase> tag, then Web+ will not execute any of the script after the initial, unclosed <webSelectCase> tag.

<webSelectCase #test-expression#>

<webCase #expression1#>

[statement-block]

<webCase #expression2#>

[statement-block]

<webCaseElse>

[statement-block]

</webSelectCase>

Example:

<webSelectCase #I#>

<webCase #0#>

<webPrint>#I# equals zero.</webPrint>

<webCase #1#>

<webPrint>#I# equals one.</webPrint>

<webCaseElse>

<webPrint>#I# is not zero or one.</webPrint>

</webSelectCase>

 

Looping Tags

Looping statements allow a script to repeat a statement-block until certain criteria have been met.

The <webFor> Tag

The <webFor> tag repeats a statement-block while incrementing a counter. The counter can be set to start and end at any value, and can be incremented by any value (even negative values). The optional <webExitFor> tag can be used to prematurely end a <webFor> loop. The <webFor> tag requires a closing </webFor> tag.

For each iteration of the loop, the step value is added to counter. If no step value is specified, Web+ assumes a default value of 1.

<webFor #counter# = #startVal# to #endVal# [step #stepVal#]>

[statement-block]

<webExitFor>

[statement-block]

</webFor>

Example

<webFor #I# = 0 to 42 step 2>

<webPrint>#I#</webPrint>

<webIf #I = 24#>

<webExitFor>

</webIf>

</webFor>

Web+ Output:

0 2 4 6 8 10 12 14 16 18 20 22 24

The <webWhile> Tag

The <webWhile> tag repeats a statement-block until a certain expression is satisfied. The optional <webExitWhile> tag can be used to prematurely end a <webWhile> loop. There must be a closing </webWhile> tag for each <webWhile>.

<webWhile #expression#>

<statement-block>

<webExitWhile>

[statement-block]

</webWhile>

Example

<webSet #I# = 1>

<webWhile #I lt 6#>

<webPrint>#I#</webPrint>

<webSet #I# = #I+1#>

<webIf #I gt 4#>

<webExitWhile>

</webIf>

</webWhile>

Web+ Output:

1 2 3 4

 

Miscellaneous Flow Control Tags

These tags control the flow of the script in various ways.

The <webInclude> Tag

The <webInclude> tag allows scripts to be added within others. This is useful as it can be used to approximate function calls. Instead of writing a block of code several times; it can be written once, saved as a file, and then included whenever it is needed. This is also useful for including common header and footer files in order to promote uniformity and to simplify changes in the future. The script parameter must be contained in quotes.

<webInclude script="scriptDirectory/scriptFileName.wml">

Example

<webInclude script="script_dir/header.wml">

The <webLocation> Tag

The <webLocation> tag redirects the browser to another URL. This is useful when a script needs to branch to a new location without having the end user click an extraneous button. When a <webLocation> command is used, nothing in the current script is sent to the browser. The URL parameter must be contained in quotes.

<webLocation URL="newURL">

Example

<webLocation URL="http://localhost/cgi-bin/webplus.exe?script=filename.wml">

The <webAbort> Tag

The <webAbort> tag will end script output immediately. Everything up to that point will be sent normally, but everything after it will be ignored.

<webAbort>

 

Chapter 12

Working with Data Sent by Users

How Data is Sent

Form and URL data

HTML forms are designed to create a degree of user interaction into an otherwise static web page. A form generally consists of blank fields into which an end user can enter data, radio switches, checkboxes, text fields and buttons; though a form can be as simple as just one button.

The <form> tag consist of two main parameters. The first is the "action" parameter. This determines where the data in the form is to be sent when the form is submitted. Its value is a URL, typically pointing to a CGI program. The second parameter is the "method" used to send the data. It can be either "POST" or "GET".

<form method={POST|GET} action=URL>

There are a number of form-related tags that can be included in a form (for a complete list, see the appendix on forms). The most common is the <input> tag. An input tag can signify a blank box which data is entered into, it can be a hidden tag used for passing constant variable settings or it could be a button used to submit the form. This is controlled by the "type" parameter of the <input> tag. A type of "text" is the default and represents a blank box into which data is entered by the user. A type of "hidden" doesn’t display anything on the screen, but stores a variable and a corresponding value. And a type of "submit" displays a button which, when clicked, submits the form to whatever URL the "action" parameter is set to by way of the "method" indicated in the <form> tag.

The "name" parameter of the <input> tag will be the name of the variable passed, and the "value" parameter will be the default value for that variable.

<input type={TEXT|HIDDEN|SUBMIT} name=VarName [Value=DefaultValue]>

Example

<form action=" /cgi-bin/webplus.exe?script=filename.wml method=POST>

Enter your name:

<input type=text name=UserName><br>

Enter your phone number:

<input type=text name=UserPhone value="(xxx)xxx-xxxx">

</form>

CGI variables

When a form is submitted, the data in that form is sent to the specified URL in one of two manners; either through the standard input (POST), or by appending them to the end of the URL (GET).

GET

When the method of GET is used, all variables are appended to the end of the URL being submitted using a slightly modified code (all spaces are replaced with a plus sign, and special characters are replaced with a hexadecimal equivalent). The drawbacks to this are:

All submitted variable data is displayed in the "current URL" window of the browser.

There is a limit on the length of the URL and therefore a limit on the amount of data that can be sent.

POST

This is the preferred method to use. It sends all the variables via the standard input. The only visible difference is that the variables are not displayed in the URL; which adds another level of security.

Resolving ambiguities in variable names

It is possible for several variables with the same name to be included in a script. For example, you may write a script which contains a <webSet> tag setting the value of the variable x. A user running your script might then submit a different value for x in a form. To distinguish between different variables of the same name, you can use the following prefixes with your variable names, listed in order of precedence (highest to lowest).

Prefix

Example Usage

Returns

QueryName

#QueryName.VariableName#

Variable returned by the given QueryName

Variables

#Variables.VariableName#

Variable set by a <webSet> tag

Form

#Form.VariableName#

Form variable

URL

#URL.VariableName#

Variable entered in URL

Cookie

#Cookie.VariableName#

Cookie variable

CGI

#CGI.VariableName#

CGI variable

If two or more of the above exist and you use #VariableName# with no prefix, it will return the value of the variable with the higher precedence.

 

Using Submitted Data

When a form is submitted to a script, the new script has access to the variables passed. For instance, if there exists a script with a form as follows:

<form method=post action=webplus.exe?script=newscript.wml>

First Name: <input type=text name=FirstName>

Last Name: <input type=text name=LastName>

Phone: <input type=text name=Phone value="(xxx)xxx-xxxx">

<input type=submit>

</form>

Then in "newscript.wml" there exist two variables, "FirstName" and "LastName". If the end user submitted the form without entering any data into those variables, the variables still exist, but contain empty strings (""). However, since the "Phone" variable had a default value indicated, it would contain the string "(xxx)xxx-xxxx", unless the user had intentionally deleted it.

Validating Form Entries

Sometimes when creating a form, you will want certain input fields to be required. For instance, if a user is filling in a form and you absolutely must have their e-mail address, you will want the e-mail field to be required. An easy way to do this is by using form field validation suffixes. These are special Web+ input name suffixes that tell Web+ what it should expect from various form fields. For example, suppose there exists a form field with the name "Age" into which a user is supposed to enter their age.

<input type=text name="Age">

To make sure that the data entered is an integer, you would add the "varName_integer" form field validation tag:

<input type=hidden name="Age_integer" Value="Please enter your age as a numeric value.">

Now, if the user should enter the value "twelve", Web+ will respond with the error message:

One or more problems exist with the data you have entered:

Please enter your age as a numeric value. (You entered 'f')

If the "Age" field is a required field, you would also add the "varName_required" form field validation tag:

<input type=hidden name="Age_required" Value="An age is required to proceed.">

This worked because the suffix "_integer" was added to the variable name in the Name= field of the hidden input tag. Here is a list of all accepted form field validation suffixes:

Validation Suffix

Explanation

_required

Data is required. Blank entries are not accepted.

_integer

Data must be an integer. Floating point values are rounded to the nearest integer.

_float

Data must be a real number.

_date

Data must fit either date format: M/D/Y or M/D. Both hyphens and slashes are accepted.

_range

Numeric data must fit inside a specified range. See below for more information.

_mask=maskstring

Data must fit the specified format. See below for more information.

Typically, you can specify a custom message in the Value= parameter of the input tag. There is one exception to this, and that is the "_range" suffix. The Value= parameter of the input tag when used with the _range suffix must fit this format:

Value="[MIN=x] [MAX=y]"

"MIN" and "MAX" represent the minimum and maximum values of the allowable range. Either one, or both of these values may be specified. If the range is exceeded, a predefined message is displayed.

The other suffix that requires further explanation is the "_mask" suffix. With this tag, you can specify a strict character format that the entered data must fit. For example, if you have a input field named "Phone" and you want the telephone numbered entered in exactly this format: "xxx-xxx-xxxx" you can add this field validation tag:

<input type=hidden name="Phone_mask=000C000C0000" Value="Please enter the phone number in the format: xxx-xxx-xxxx.">

If the user enters the phone number in the format "xxxxxxxxxx", Web+ will return the error message:

One or more problems exist with the data you have entered:

Please enter the phone number in the format: xxx-xxx-xxxx. (You entered 'xxxxxxxxxx')

Here is a list of all the characters which can be used with the "_mask=" suffix:

Character

Purpose

0

Digit placeholder, one digit per placeholder.

?

Digit placeholder, any number of digits per placeholder.

.

Decimal placeholder.

,

Thousands placeholder.

:

Time separator.

/

Date placeholder.

\

Treat the next character in the mask string as a literal.

C

Character placeholder, one character per placeholder.

c

Character placeholder, any number of characters per placeholder.

A

Alphanumeric placeholder, one alphanumeric character per placeholder (a-z, A-Z, 0-9)

a

Alphanumeric placeholder, any number of alphanumeric characters per placeholder (a-z, A-Z, 0-9)

Z

Letter placeholder, one letter per placeholder (a-z, A-Z).

z

Letter placeholder, any number of letters per placeholder (a-z, A-Z).

|

OR separator. Either nothing, or one of multiple items. (eg, "Y|N", "M|F", "A|B|C|D…")

Example

<form action=webplus.exe?script=test.wml method=post>

Full Name: <input type=text name=FullName>

E-mail address: <input type=text name=Email> (required)

Age: <input type=text name=Age>

<input type=hidden name="Email_required" Value="You must include a valid e-mail address!">

<input type=hidden name="Age_integer" Value="The age you entered was not a valid integer!">

</form>

Submitted Variable Functions

To find out how many variables have been submitted to a script, you can use the NumSubmittedVars() function. This function will return the total number of variables submitted both by POST operations and via the URL. The function NumSubmittedURLVars() will return the number of variables submitted only via the URL. To determine the number of variables submitted solely by a POST operation, subtract NumSubmittedURLVars() from NumSubmittedVars().

NumSubmittedVars()

NumSubmittedURLVars()

When you have an unknown number of unknown variables submitted to a script, you can determine their names and values with the SubmittedName() and SubmittedValue() functions. Each function takes as a parameter an index value, from 1 to however many variables were submitted (determined with the NumSubmittedVars() function).

SubmittedName (index)

SubmittedValue (index)

Example

<webPrint>

Total number of variables submitted = #NumSubmittedVars()#<br>

Variables submitted via the URL = #NumSubmittedURLVars()#<br>

Variables submitted via POST operation = #NumSubmittedVars() - NumSubmittedURLVars()#<br>

</webPrint>

<webFor #i# = 1 to #NumSubmittedVars()#>

<webPrint>

Variable number #i#, #SubmittedName(i)#, has value: #SubmittedValue(i)#<br>

</webPrint>

</webFor>

Web+ Output:

Total number of variables submitted = 1

Variables submitted via the URL = 1

Variables submitted via POST operation = 0

Variable number 1, script, has value: filemame.wml

 

Chapter 13

Additional Web+ Functions and Tags

Date and Time Related

Web+ offers several functions associated with dates and times. Some functions will retrieve the current date and time, while others will format the display thereof, or calculate differences between dates.

Function

Returns

CurrentDate ()

Current date in yyyy-mm-dd format.

CurrentTime ()

Current time in hh:mm:ss format (in 24 hour mode).

CurrentDateTime ()

Current date and time in yyyy-mm-dd hh:mm:ss format.

DateDiff (Method, Date1, Date2)

Returns the difference between two dates and times in any format requested.

WeekDay (dateString)

An integer corresponding to the day of the week the specified date falls on, (1=Sunday & 7=saturday) or null if the date string is invalid.

IsDate (dateString)

True if dateString can be converted to a valid date.

DateFormat (dateString, Method)

dateString formatted as specified by Method.

TimeFormat (dateString, Method)

dateString formatted as specified by Method.

DatePart (Option, dateString)

A subset of the dateString, as specified by the Option.

Example

<webPrint>

The current date is #CurrentDate()#.<br>

The current time is #CurrentTime()#.<br>

The current time is #CurrentDateTime()#.<br>

Alternate date display: #DateFormat (CurrentDate(), "m/d/yy")#<br>

Alternate time display: #TimeFormat (CurrentTime(), "h:n AM")#<br>

</webPrint>

Web+ Output:

The current date is 1997-03-07.

The current time is 15:36:31.

The current time is 1997-03-07 15:36:31.

Alternate date display: 3/7/97

Alternate time display: 3:36 P.M.

Example

<webPrint>

#DateDiff ("s", a, b)#,

#DateDiff ("n", a, b)#,

#DateDiff ("h", a, b)#,

#DateDiff ("d", a, b)#

</webPrint>

Web+ Output:

65858400, 1097640, 18294, 762

Example

<webSet #day[]# = ",,Sun,Mon,Tue,Wed,Thu,Fri,Sat">

<webPrint>

July 5th, 1998 is a #day[WeekDay ("July 5, 1998")]#.

</webPrint>

Web+ Output:

July 5th, 1998 is a Sun.

Example

<webSet #dateStr# = "1997-02-13 3:45:09">

<webPrint>

#dateStr#<br>

Year = #DatePart ("yyyy", dateStr)#<br>

Month = #DatePart ("m", dateStr)#<br>

Day = #DatePart ("d", dateStr)#<br>

Hour = #DatePart ("h", dateStr)#<br>

Minute = #DatePart ("n", dateStr)#<br>

Second = #DatePart ("s", dateStr)#<br>

Day of Year = #DatePart ("y", dateStr)#<br>

</webPrint>

Web+ Output:

1997-02-13 3:45:09

Year = 1997

Month = 2

Day = 13

Hour = 3

Minute = 45

Second = 9

Day of Year = 44

 

Working With String Lists

To make working with string lists more convenient, Web+ offers a few specialized functions.

ValueList and QuotedValueList

To generate a string list based on information received through a database query, you can use the functions ValueList() and QuotedValueList(). See the section on Executing Database Queries for more information.

ValueList (queryName.FieldName)

QuotedValueList (queryName.FieldName)

Each function returns a string list of the values contained in the field specified by FieldName.

Example

<webDbQuery name=thisQuery datasource=WebPlus_Examples

SQL="SELECT LastName,AddressID FROM Addresses">

<webPrint>

Quoted list of Last Names = #QuotedValueList (thisQuery.LastName)#<br>

List of Address Ids = #ValueList (thisQuery.AddressID)#<br>

</webPrint>

Web+ Output:

Quoted list of Last Names = 'Davolio','Fuller','Leverling','Peacock','Buchanan','Lee'

List of Address Ids = 1,2,3,4,5,38

ListCount and GetListElement

To find out more about a string list, there exist these two functions:

ListCount (StrList, [Del])

GetListElement (StrList, Index, [Del])

In each case, strList is a string list variable; that is, a number of elements separated by a delimiter character. Del refers to this delimiter character. If none is specified, the default (a comma) is used. ListCount() will return the number of elements in a string, and GetListElement will return the element corresponding to the given Index value. If the Index specified is greater than the number of elements in the list, the function returns nothing.

Example

<webSet #strList# = "one,two,three,four,five,six">

<webPrint>

Number of elements = #ListCount (strList)#<br>

The third list element = #GetListElement (strList, 3)#

</webPrint>

Web+ Output:

Number of elements = 6

The third list element = three

 

Environmental Information

Web+ provides a number of functions and variables which can reveal information about the environment of the server.

Function

Returns

CurrentPath()

The path of the current script.

WebGetVersion()

Client Compile Number | Server Compilation number | Server Type

GetTempFileName()

The file name of the system level temp file which will be used for File I/O. You must first predefine a logical and physical path for \temp\. If the Windows environment variable TMP is set, then that setting will be used regardless of the setting in the webpsvr.ini file.

Example

<webPrint>

The current path is #CurrentPath()#.

The temporary file name is #GetTempFileName()#.

</webPrint>

Web+ Output:

The current path is C:\webplus\script.

The temporary file name is \Temp\webp2.

Environment Variables

These variables are set every time the server executes Web+.

Variable

Explanation

SERVER_SOFTWARE

The name and version of the information server software answering the request (and running the gateway). Format: name/version.

SERVER_NAME

The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.

GATEWAY_INTERFACE

The revision of the CGI specification to which this server complies. Format: CGI/revision.

SERVER_PROTOCOL

The name and revision of the information protocol this request came in with. Format: protocol/revision.

SERVER_PORT

The port number to which the request was sent.

REQUEST_METHOD

The method with which the request was made. For HTTP, this "GET", "HEAD", "POST", etc.

PATH_INFO

The extra path information, as given by the client. In other words, scripts can be accessed by their virtual path name, followed by extra information at the end of this path. The extra information is sent as PATH_INFO.

PATH_TRANSLATED

The server provides a translated version of PATH_INFO, which takes the path and does any virtual-to-physical mapping to it.

SCRIPT_NAME

A virtual path to the script being executed, used for self-referencing URLs.

QUERY_STRING

The information which follows the ? in the URL that referenced this script. This is the query information.

REMOTE_HOST

The host name making the request. If the server does not have this information, it sets REMOTE_ADDR and leaves this un-set.

REMOTE_ADDR

The IP address of the remote host making the request.

AUTH_TYPE

If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user.

REMOTE_USER

If the server supports user authentication, and the script is protected, this is the user name they have authenticated as.

REMOTE_IDENT

If the HTTP server supports RFC 931 identification, then this variable will be set to the remote user name retrieved from the server. Usage of this variable should be limited to logging only.

CONTENT_TYPE

For queries which have attached information, such as HTTP POST and PUT, this is the content type of the data.

CONTENT_LENGTH

The length of the said content as given by the client.

 

Web+ Configuration

Functions and commands related to the configuration of Web+.

Web+ Cache Technique

Web+ client-server version adopts cache technique to improve the

performance. User can define the size of the cache web+ can use to hold wml script

files in memory.

When web+ server tries to execute a script file, it first checks if it is

in the cache. If it is, then web+ will access the last update time of this

file, and compare it with the one in cache. If they are equal, web+ will

simply uses the content in cache to execute. This will save much time of

IO. If the update time of this file is different with the one cached, web+

will simply dump out the cached file content and load the file into cache

as it is never in cache.

When Web+ loads a file into cache, it will first check if the space left

unused in cache is enough to hold this file. If it can, web+ simply loads

this file into cache; If not, web+ will swap the most recent unused script

out of cache till a enough space is found or there is nothing in cache. If

there is nothing in cache but the space is still not enough, web+ will

simply load the file into a thread private memory to execute without

caching.

Web+ cache is especially useful when your script file is encrypted. Web+

will decrypt it when loading into cache. This is save lot time compared to

loading and decrypting every time.

WebIniGet Function

The WebIniGet function will return the current value of the specified Web+ key name. The value returned is the value stored in memory, not necessarily the one in the .INI file. If an administration password is required, it will need to be passed to the function as well.

WebIniGet (KeyName, [AdminPassword])

WebIniPut Function

This function will set a Value to a KeyName in a specified Section of the webpsvr.ini file. Note: when a key is changed in this manner, it does not go into effect until a <webIniRefresh> command is called, although the actual .ini file is immediately updated. This function returns 1 on success.

WebIniPut (SectionName, KeyName, Value, [Password=AdminPassword])

The <webIniRefresh> Tag

After a WebIniPut() function, Web+ must be refreshed with the new copy of the webpsvr.ini file. This function is used to do just that. If an Admin Password has been specified in the webpsvr.ini file, it must also be present in the command.

<webIniRefresh [password=AdminPassword]>

Example

<webPrint>

The Admin Email Address: #WebIniGet ("AdminEmail", "webplusPW")#.<br>

#WebIniPut ("Admin", "AdminEmail", "admin@domain.com", "webplusPW")#

</webPrint>

<webIniRefresh password="webplusPW">

Web+ Output:

The Admin Email Address: admin@domain.com

1

 

Client State Variables

Using client state procedures, variables can be made to persist from script to script by being saved in the server’s Window’s registry and by being indexed with a user ID. The benefit of this behavior is that a variable can be made to persist from one session to another. For example, if a client state variable is set by a Web+ script, then every Web+ script that is part of the same session, with the same user ID can access and modify that variable. To enable, or disable, client state behavior for a specific script, use the <webClient> command.

<webClient [name=SessionName] [Persistent=0|1] [UCID={Cookie|IP|Name}]>

Simply issuing the command <webClient> will enable the client state variables with no name. You can specify a session name with the Name parameter. Session names are useful in that variables with identical names in different applications can be differentiated by which session they are associated with. The Persistent parameter defaults to "1", which enables Client State Variables. To turn client state variables off, set Persistent=0. By default, the way that Web+ keeps track of the user ID is by setting a cookie on the browser. This can overridden by changing the setting of UCID. If you set UCID to "IP", then Web+ will monitor the IP address of the browser, and differentiate between end users based on that. You can also set UCID to any character string, forcing Web+ to treat all end users using that Web+ script as the same.

Client state variables are accessed by appending the special prefix "client" to the beginning of the variable’s name. Only variables associated with the current session name are accessible. If no session name was specified, then only variable not associated with any session name are accessible.

#client.Variablename#

When a session is started, three system variables are created. These three variables are: TimeCreated, HitCount and LastVisit.

Variable Name

Purpose

TimeCreated

The time the current client state session started.

HitCount

The number of times a client state variable was accessed.

LastVisit

The last time a client state variable was accessed.

Client State Functions

There are three functions specifically designed to manipulate client state variables. These functions will only affect those client state variables that are associated with the current session (as specified by the initial <webClient> command).

Function

Purpose

ClientVarList()

Returns a comma separated list of all the variables associated with the current session.

ClientDeleteVar("client.VariableName")

Deletes the specified variable associated with the current session. Note: the VariableName must be enclosed in quotes. Returns 1 on success.

ClientDeleteAllVars()

Deletes all variables associated with the current session, including TimeCreated, HitCount and LastVisit. Returns 1 on success.

 

Example

<webClient name=ThisSession Persistent=1>

<webSet #client.userId# = 120>

<webPrint>

User Id Before = #client.userId#<br>

Deleting User Id = #ClientDeleteVar ("client.userId")#<br>

User Id After = #client.userId#<br>

All Variables = #ClientVarList()#<br>

TimeCreated = #client.TimeCreated#<br>

HitCount = #client.HitCount#<br>

LastVisit = #client.LastVisit#<br>

</webPrint>

Web+ Output:

User Id Before = 120

Deleting User Id = 1

User Id After =

All Variables = TimeCreated,HitCount,LastVisit,userId

TimeCreated = 1997-02-10 20:16:22

HitCount = 1

LastVisit = 1997-02-10 20:16:22

 

Cookie Variables

A cookie is a variable that can be set on the end user’s browser. The browser will maintain the cookie until a preset expiration date. Cookie variables can be set and retrieved by Web+ very easily with the use of a couple functions.

Setting a Cookie Variable

Cookies can be set using the <webCookie> command.

<webCookie Name=CookieName Value=CookieValue Expires=Expiration Secure=SecurityOption>

Cookie variables have a Name which corresponds to a Value. With the Expire parameter, a cookie can be set to expire on a specific date, in a specific number of days, right now or never. To expire a cookie on a specific date, simply specify that date; to expire a cookie in a set number of days, simply specify the number of days. Specify "NOW" to cause the cookie to expire immediately, and specify "NEVER" to have the cookie never expire. You can also specify the security requirements for setting a cookie with the Secure parameter. If the browser does not support SSL security, the cookie will not be set.

Retrieving a Cookie Variable

To retrieve a cookie that has already been set, simply append the cookie variable name with the prefix "cookie". For example, if a cookie called UserId has been set on the browser, you can access the value of it by using the expression #cookie.UserId#.

Example

<webSet #n# = 5>

<webCookie Name=x Value=#n# Expires=10>

<webPrint>

The value of n is #cookie.x#.

</webPrint>

Web+ Output:

The value of n is 5.

 

Miscellaneous Functions

Web+ offers an assortment of unique functions that are useful in specific situations.

ArrayCount

This function returns the number of elements in the specified array.

ArrayCount (ArrayName)

Example

<webSet #a[]# = ",zero,one,two,three,four">

<webPrint>

Number of elements in array = #ArrayCount (a)#<br>

</webPrint>

<webFor #I# = 0 to #ArrayCount(a)-1#>

<webPrint>

#I# : #a[I]#<br>

</webPrint>

</webFor>

Web+ Output:

Number of elements in array = 5

0 : zero

1 : one

2 : two

3 : three

4 : four

FileTime

This function will return the time and date which a file was last modified, or accessed.

FileTime (FileName, Method)

FileName is the name of the file in question. This filename must conform to the physical and logical paths set forth in the File I/O section of the webpsvr.ini file. The Method parameter determines which date and time you want to know. Valid values are "Modified" and "Accessed".

Example

<webPrint>

The admin.wml file was last modified on #FileTime ("/webplus/admin/admin.wml", "Modified")#.

</webPrint>

Web+ Output:

The admin.wml file was last modified on 01/22/1997 18:33:40.

The IsNumeric Function

The IsNumeric() function takes any expression and returns 1 if that expression can be converted into a legitimate number.

IsNumeric (Expression)

Example

<webPrint>

#IsNumeric (3)#

#IsNumeric ("b")#

</webPrint>

Web+ Output:

1 0

ParameterExists

If a variable has been defined, this function will return 1. This is useful in situations where a number of variables has been passed to a script by way of a form action, and the script needs to know whether some variables have been defined or not.

ParameterExists (variableName)

Example

<webSet #a# = "Anything">

<webSet #b# = "">

<webPrint>

#ParameterExists (a)#

#ParameterExists (b)#

#ParameterExists (c)#

</webPrint>

Web+ Output:

1 1 0

TreatedAsVar

This function takes an expression and then converts that expression into a variable name. In essence, this function lets the script treats the passed expression as a variable.

TreatedAsVar (Expression)

Example

<webSet #a1234# = "Any Variable">

<webSet #x# = 1200>

<webSet #y# = 34>

<webPrint>

a1234 = #a1234#<br>

a1234 = #TreatedAsVar ("a" & (x + y))#

</webPrint>

Web+ Output:

a1234 = Any Variable

a1234 = Any Variable

UploadFile

Netscape Navigator allows a user to upload files through the World Wide Web. This is achieved via special forms containing two extra elements not found in regular forms. The first is an extra parameter in the <form> tag: enctype="multipart/form-data". The other is a new input field called "file". That is: <input type=file>. When a file is uploaded to a Web+ script in this manner, Web+ saves it in the temp directory with an assigned Web+ name (typically "webpN", where ‘N’ is an integer). The function, uploadFile(), returns the name Web+ assigned to the uploaded file, thus enabling you to rename and move the file as desired.

Example

Consider this HTML form, containing no special Web+ tags:

<form enctype="multipart/form-data" action=webplus.exe?script=test.wml method=post>

Send this file:

<input name=userfile type=file>

<input type=submit>

</form>

The <input name=userfile type=file> tag will display a regular text field and a corresponding "Browse…" button. The end user can use the "Browse" button to select a file to upload from their local directory structure. When the user clicks "Submit", the form then passes the file name to the test.wml script file, and uploads the file to the web server. The following script is "test.wml", which returns both the original name of the file uploaded, and the name Web+ assigned to the file.

<webPrint>

Original file name (userfile)=#userfile#<br>

Web+ assigned name (uploadFile)=#uploadFile(userfile)#

</webPrint>

Example Web+ Output:

Original file name (userfile)=D:\Netscape\Program\bookmark.htm

Web+ assigned name (uploadFile)=\Temp\webp5

ValidateCC

This functions determines the validity of a submitted credit card number. If the credit card number is invalid (because it is an invalid number, or because the variable is empty) it returns false. Otherwise the function returns a positive integer corresponding to the type of card submitted (1=American Express, 2=Visa, 3=Master Card, 4=Discover, 9=Unknown).

ValidateCC (ccNumber)

Example

<webSelectCase #ValidateCC(ccNumber)#>

<webCase #0#>Invalid credit card number

<webCase #1#>American Express

<webCase #2#>Visa

<webCase #3#>Master Card

<webCase #4#>Discover

<webCase #9#>Unknown

</webSelectCase>

 

Miscellaneous Tags

webPGP

Provides PGP(Pretty Good Privacy) encryption .

General format:
<webPGP Action="Encrypt" FromFile=FromFile FromPassword=Password>
or
<webPGP Action="AddKey" Key=Key >

To do encryption, use this format:
<webPGP Action="Encrypt"
{FromFile=FromFile | FromText=TextString }
{ToFile=ToFile | ToVar=ToVar }
UserIDs=UserID FromPassword=FromPassword ToPassword=ToPassword>

 

Example

<webPGP Action="Encrypt" FromText="Hello" ToVar=#XY#

UserIDs="Ming" Ret=#OK#>

<webIf #OK#>

<webPrint> #XY#<BR> </webPrint>

</webIf>

<webPGP Action="Encrypt" FromFile="/test.txt" ToVar=#XY#

UserIDs="Ming" FromPassword="read" ToPassword="write" Ret=#OK#>

<webIf #OK#>

<webPrint> #XY#<BR> </webPrint>

</webIf>

Web+ Output:

webCyberCash

Provides On-Line cash transaction.

 

<webCyberCash

Host=host machine running CyberCash Register Server

Port=...

MerchantPassword=...

TransType="mauthonly" or "mauthcapture"

OrderID=a unique id

Price=...

CCNumber=...

CCExp=...

CCName=...

CCAddress=...

CCCity=...

CCState=...

CCZip=...

CCCountry=...>

 

Example

<webCyberCash Server="n44.cs.fiu.edu" MerchantPassword="secret-test-ckfre"

TransType="mauthonly"

OrderID="12345" Price="usd 4.5" CCNumber="..." CCExp="04/98"

CCName="Whatever" CCAddress="41 Street" CCCity="Miami"

CCState="FL" CCCountry="USA">

<webPrint>

#MStatus#<BR>

#MErrMsg#<BR>

</webPrint>

 

webCounter

Cause certain merely GIF images to be displayed.

 

<webCounter Value=… >

 

Example

<webCounter Value="12131" FrameThick=6 FrameColor="128,0,0" DigitStyle="B" UseStrip=1>

webSynchronized

Make sure only one process could enter critical section at the same time.

 

<webSynchronized>

[Statementsblock]

</ webSynchronized >

 

Example

<websynchronized>

<webIf ParameterExists(#shared.count#)>

<webSet #shared.count# = #shared.count#+1>

<webElse>

<webSet #shared.count# = 1>

</webIf>

</webSynchronized>

Web+ Output:

webPushPage

Used to implement server push for those browsers support this feature.

 

<webPushPage ContentType=…>

… … … …

</webPushPage Exit>

 

Example

<webSet #I#=0>

<webContent type="ServerPush" Password="try">

<webWhile #1#>

<webPushPage ContentType="text/html">

<webPrint>

Hello Ming Zeng#I#<BR>

Hello#I#<BR>

</webPrint>

<webSet #I# = #I+1#>

</webPushPage>

<webSleep Seconds=4>

</webWhile>

<webPushPage ContentType="text/html">

Hello, This is Push<BR>

Hello<BR>

</webPushPage>

<webSleep Seconds=6>

<webPushPage ContentType="text/html">

Ok, Hello, How are you<BR>

Ok, Hello<BR>

</webPushPage Exit>

Web+ Output:

webSleep

Suspend the execution of a script for a designated time.

 

<webSleep Ssconds=>

 

Example

<webSleep Seconds=10>

Web+ Output:

webCall

Show cristal report’s files on web brower.

 

<webCall Script=... Param1=Exp1 [byref|byval] Param2=Exp2
[byref|byval] ... Paramn=Expn [byref|byval]
>

 

Example

<webcall Script="/subroutine/sub1.wml" Name="try"

Value="1234"byval

Result=#Root# byref>

Web+ Output:

WebReport

Show cristal report’s files on web brower.

 

<webReport Report=... UrlBase=... DirForUrlBase=... Datasource=...
OrderBY=... @formular1=... @formular2=... ...
@formularn=... >
query statement

</webReport>

 

Example

<webReport report="/student.rpt">

{STUDENT.last_name} IN "Naboulsi" and {STUDENT.birth_year} > 1969

</webReport>

Web+ Output:

ActiveX(OLE) automation interface

ActiveX or other object can be embeded in web+ scripts.

<webObject ProgID=… AS=… Local=… ServerType=… >

Example

<WebObject ProgID="Excel.Application" As="test">

<WebSet #test.visible# = 0>

<webSet #y#=#test.checkspelling("ddd")#>

<WebSet #x# = #test.quit()#>

<webPrint>

Start Exel, hide it, then Quit<BR>

<webIf #y#>

Correct word<BR>

<webElse>

Not in Dictionary<BR

</webIf>

</webPrint>

Web+ Output:

webAuthenticate

Makes the web browser display a authentication dialog box, which prompts the user for a user name and password. These variables can be accessed as CGI variables with the "CGI" prefix.

<webAuthenticate>

Example

<webAuthenticate>

Web+ Output:

webBeep

This command will cause the Web server to beep with its default beep sound.

<webBeep>

webContent

This command will define the content-type being returned by the current script.

<webContent Type=ContentType>

Example

<webContent Type="Text/Html">

webEval

This command will evaluate the expression passed to it and return the value of that expression.

<webEval CodeVar=Variable Ret=ReturnVar>

Example

<webSet #v# = "##1+2##">

<webEval CodeVar=#v# Ret=#r#>

<webPrint>

v=#v#, r=#r#

</webPrint>

Web+ Output:

v=#1+2#, r=3

webVarExistCheck

By default, Web+ will check whether or not each variable it encounters has been defined. IF it has not, Web+ will stop parsing the script and display an error message to that effect. This feature can be disabled with the <webVarExistCheck> tag. Simply give it the parameter "Off" and Web+ will treat undefined variables as null variables. To re-enable variable checking, re-issue the command with the parameter "On".

<webVarExistCheck {On|Off}>

Example

<webVarExistCheck Off>

<webPrint>

#noVar#

</webPrint>

Made it!

Web+ Output:

Made it!

 

Chapter 14

Printing Information Obtained From a Database

SQL Command Summary

SELECT FieldName,FieldName FROM TableName WHERE IntField=13 AND CharField='Text' AND ValueField > 2

SELECT * FROM TableName WHERE Id=#userID# AND name='#name#' AND password='#password#'

INSERT INTO TableName (FieldName,FieldName,FieldName) VALUES (14, 'Char', '#charVar#')

UPDATE TableName SET FieldName=14,FieldName='Char',FieldName='#charVar#'

DELETE FROM TableName WHERE IntField=14 AND CharField='New'

CREATE TABLE TableName (FieldName INT, FieldName CHAR(5), FieldName DATE)

DROP TABLE TableName

Executing Queries with Web+

To execute a query, the <webDbQuery> tag is used. The only two parameters the tag requires are the datasource of the database to query and the SQL statement to send it. It may also be assigned a name, for reference later on.

To limit the number of rows to be returned by the query, add the MaxRows parameter; and to limit the amount of time spent executing a query, add the TimeOut parameter (the value is in milliseconds). The TimeOut parameter is not supported by most ODBC drivers. The Debug parameter may also be included, it will cause Web+ to display information about the query for debugging purposes.

<webDbQuery DataSource=DataSourceName [Name=QueryName] SQL=SQLstatement [MaxRows=Num] [TimeOut=Milliseconds] [Debug]>

Example

<webDbQuery datasource=DSName SQL="SELECT PhoneNumber FROM Users WHERE Name=’Bob’">

Example

<webDbQuery Name=ThisQuery datasource=DSName SQL="SELECT * FROM Users" MaxRows=30 TimeOut=3000>

 

Printing Query Results

To print the results of a select query, use the <webPrint> tag and supply the name of the query whose results you want to print:

<webPrint query=Queryname>

Everything between the <webPrint> tag and the corresponding </webPrint> tag will be processed once for each record returned by the query. Inside a <webPrint query=…> loop, you don't need to specify the queryName prefix for variables related to that query. If you want to access a variable from another query inside a <webPrint query=…> loop (or inside any regular <webPrint> container) you will need to specify which query the variable is from by appending the queryName prefix.

Web+ also offers the ability to "nest" queries. That is, you can embed one <webPrint query=…> loop inside of another <webPrint query=…> loop for greater control. And for even greater control, Web+ also lets you specify which row to start your <webPrint query=…> loop on.

<webPrint query=Queryname startRow=rowNumber>

To find the number of records returned by your query, use the reserved variable "RecordCount".

#QueryName.RecordCount#

This will return the number of records returned by the query specified by queryName.

Example

Here is an example which demonstrates how to print the results of a select query. It uses the WebPlus_Examples database. This database contains a table called Addresses, which itself has fields called "FirstName", "LastName" and "City". The data source name for this database is called "WebPlus_Examples".

<webDbQuery name=Locations datasource="WebPlus_Examples"

SQL="SELECT FirstName, LastName, City FROM Addresses">

<webIf #Locations.RecordCount = 0#>

There are no people in the Addresses table!

<webElse>

Here is a list of all the people and their cities:

<webPrint query=Locations>

<li>#FirstName# #LastName# from #City#.

</webPrint>

</webIf>

Web+ Output:

Here is a list of all the people and their cities:

Nancy Davolio from Seattle.

Andrew Fuller from Tacoma.

Janet Leverling from Kirkland.

Margaret Peacock from Redmond.

Steven Buchanan from London.

Susan Lee from Washington, D.C..

 

Printing a Formatted List of Query Results

The function #ValueList (Queryname.Fieldname)# returns a comma-separated list. Each item in the list corresponds to one record returned by the query, and each item is the value of the specified field of that record. The variable #QuotedValueList (Queryname.Fieldname)# returns the same list, but with each item enclosed in single quotes.

Example

This example uses the same data as above.

<webDbQuery name=Locations datasource="WebPlus_Examples"

SQL="SELECT FirstName, LastName, City FROM Addresses">

<webPrint>

#ValueList (Locations.FirstName)#<br>

#QuotedValueList (Locations.City)#

</webPrint>

Web+ Output:

Nancy,Andrew,Janet,Margaret,Steven,Susan

'Seattle','Tacoma','Kirkland','Redmond','London','Washington, D.C.'

 

Chapter 15

File Manipulation

Introduction to File Manipulation

Maintaining Paths for File I/O

Web+ allows the addition of any number of logical and corresponding physical paths. These control where users may access files. Different logical paths can have different read and write passwords in order to provide further control over what directories scripts have access to. These logical paths and passwords can be created and modified via the Server Manager.

First, log into the Server Manager (see the section on the Server Manager for instructions), then select the "File I/O" option. Therein should be a list of all existing file paths. At the bottom of the list, there is a section into which a new file path can be added. Add the logical and physical path, designate if read or write access will be allowed and assign passwords to each access mode. If a password field is left blank, then no password will be required to perform that access mode. After these settings have been filled in, chose "Add New File Path" and the page will reload. When it does so, the new file path should be displayed. Finally, choose "Logout" and Web+ will be ready to use the new file path.

 

Manipulating Files

Web+ offers the ability to do file manipulation and handling. Each function in this section contains at least one parameter that references a file on the server. These references are subject to the logical/physical path combinations specified in the [FILE IO] section of the webpsvr.ini file.

File Copying

<webFileCopy From=sourceFileName To=destinationFileName [Ret=#result#] [FromPassword=ReadPassword] [ToPassword=WritePassword]>

The From and To parameters specify the existing and desired file name, respectively. If Web+ successfully copies the file, Ret will be set to 1, otherwise it is set to 0. If either a read or write password is required, they can be specified with the FromPassword and ToPassword parameters.

Example

<webFileCopy From="/log/webplus.log" To="/log/newwebplus.log" FromPassword="webplus" ToPassword="webplus">

File Renaming

<webFileRename From=oldFileName To=newFileName [Ret=#result#] [FromPassword=ReadPassword] [ToPassword=WritePassword]>

The From and To parameters specify the existing and desired file name, respectively. If Web+ successfully renames the file, Ret will be set to 1, otherwise it is set to 0. If either a read or write password is required, they can be specified with the FromPassword and ToPassword parameters.

Example

<webFileRename From="/log/newwebplus.log" To="/log/newerwebplus.log" FromPassword="webplus" ToPassword="webplus">

File Deleting

<webFileDelete Name=FileName [Ret=#result#] [Password=WritePassword]>

The Name parameter specifies the file name of the file to be deleted. If Web+ successfully deletes the file, Ret will be set to 1, otherwise it is set to 0. If a write password is required, it can be specified with the Password parameter.

Example

<webFileDelete Name="/log/newerwebplus.log" Password="webplus">

 

Directories

Web+ offers the ability to do file manipulation and handling. Each function in this section contains at least one parameter that references a file on the server. These references are subject to the logical/physical path combinations specified in the [FILE IO] section of the webpsvr.ini file.

In addition to manipulating files, you can also manipulate the directory structure.

Current Directory

webCurDir()

To determine the current working directory, call this function with no parameters. The function returns the current physical directory.

Change Directory

webChDir(DirectoryName)

To change the current physical directory, call this function with DirectoryName set to the name of the new directory. DirectoryName can be either absolute or relative.

Make Directory

webMkDir(DirectoryName)

To make a new physical directory, call this function with DirectoryName set to the name of the new directory. DirectoryName can be either absolute or relative.

Remove Directory

webRmDir(DirectoryName)

To remove an existing physical directory, call this function with DirectoryName set to the name of the directory to remove. DirectoryName can be either absolute or relative. You cannot remove directories that are not empty, nor can you remove the current directory.

Example

<webPrint>

Change current directory: #webChDir("e:\webplus")#<br>

Current Directory: #webCurDir()#<br>

Create new directory: #webMkDir("tmp")#<br>

Move into new directory: #webChDir("tmp")#<br>

Current Directory: #webCurDir()#<br>

Move back: #webChDir("..")#<br>

Remove new directory: #webRmDir("tmp")#<br>

Current Directory: #webCurDir()#<br>

Move into unavailable directory: #webChDir("tmp")#

</webPrint>

Web+ Output:

Change current directory: 1

Current Directory: e:\webplus

Create new directory: 1

Move into new directory: 1

Current Directory: e:\webplus\tmp

Move back: 1

Remove new directory: 1

Current Directory: e:\webplus

Move into unavailable directory: 0

 

Doing File I/O

Opening Files for Input and Output

Web+ has the ability to read from and write to files stored on the server. In the [File IO] section of the webpsvr.ini file, logical and physical paths can be specified, as well as read and write passwords.

<webFileOpen>

To open a file for input or output, the <webFileOpen> command must be used.

<webFileOpen Name=FileName Mode={Read|Write|Append} As=FileHandle Ret=#returnVar# [Lock={Shared|Read|Write|Read Write}] [Password={ReadPassword|WritePassword}]>

Name is the filename of the file to access, it must be contained in quotes. Mode is the method of access to use, valid methods are Read, Write and Append. If you attempt to Write to a file that already exists, the file will be overwritten. As is the handle associated with this file. This handle is how subsequent calls will refer to this opened file. If the <webFileOpen> command is successful it will set the Ret variable to 1, otherwise it will be set to 0. For additional <webFile…> commands, this same Ret variable will be set to either "EOF" or "NOEOF", indicating whether or not the end of the file has been reached. If a password is specified in the webpsvr.ini file, it will have to be set with the Password parameter. In a multi-user environment, access can be restricted to the file by setting the Lock parameter:

Lock Type

Value

Shared

Any process on any machine can read from or write to this file.

Read

No other process is granted read access to this file.

Write

No other process is granted write access to this file.

Read Write

No other process is granted read or write access to this file.

Reading From a File

There are two functions that will retrieve data from an opened file, <webFileGetChar> and <webFileGetLine>. A file must first be opened in either read or append mode for them to function correctly. To identify when the end of the file has been reached, check the Ret variable set with the <webFileOpen> command. If the end of the file has been reached, it will be set to "EOF", otherwise it will be "NOEOF". The <webFileGetChar> command will retrieve the next character from the specified file and put it into the Result variable, while the <webFileGetLine> command will retrieve the next line (up to and including the end of line character) and put it into the Result variable.

<webFileGetChar File=MyHandle Result=#c#>

<webFileGetLine File=MyHandle Result=#string#>

File is the handle of the existing opened file to read from. Result is the variable into which the character will be put.

Writing To a File

There are two functions that will write data to an opened file, <webFilePutChar> and <webFilePutLine>. In order for these functions to work, the file must be opened in either write or append mode. The <webFilePutChar> command will output one character to the specified file. The <webFileGetLine> command will output a string (with an added end of line character) to the file.

<webFilePutChar File=MyHandle Value=#c#>

<webFilePutLine File=MyHandle Value=#string#>

File is the handle of the existing opened file to write to. Value is the character or string to be outputted to the file.

Closing files

After all input and output has been completed for a specific file, the file should be closed. You can specify which file stream to close by supplying its handle, or you can close all open files by issuing just the <webFileClose> command.

<webFileClose [File=MyHandle]>

Read From File Example

This example will open the Web+ log file for input and display its contents.

<webFileOpen Name="/log/webplus.log" Mode=Read As=LogFile Ret=#EOF# Password="webplus">

<webIf #!EOF#>

Could not open file.

<webElse>

<webWhile #EOF != "EOF"#>

<webFileGetLine File=LogFile Result=#s#>

<webPrint>#s#</webPrint><br>

</webWhile>

</webIf>

<webFileClose File=LogFile>

Write To File Example

This example will open the Web+ log file, and append a line of text to it.

<webFileOpen name="/log/webplus.log" mode=Append As=LogFile Ret=#EOF# Password="webplus">

<webSet #s# = "The log file has been displayed to this point.">

<webFilePutLine File=LogFile value=#s#>

<webFileClose File=LogFile>

 

Working with INI Files

What is an INI file?

An .INI file is typically an initialization file that stores settings and configuration variables for an application. Initialization files consist of "keys" and "values" organized into "sections".

[SectionName]

KeyName=Value

Section names are enclosed in brackets, and keys are names associated with values.

Manipulating .INI Files

There are two Web+ functions which make working with .INI files easy. These functions are <webGetProfile> and <webPutProfile>, which will get a key value from an .INI file and put a key’s value in an .INI file, respectively.

<webGetProfile>

This command searches an .INI file for the specified key and returns the value associated with that key.

<webGetProfile File=FileName Section=SectionName Key=KeyName Result=#value# [Size=BufferSize] Password=ReadPassword>

File is the file name of the .INI to be searched (and is subject to the logical path names specified in the FILE I/O section of webpsvr.ini), Section is the section name that the key should be found in and Key is the name of the key itself. Result is the variable that the key’s value will be placed into. Size is the maximum length of the key to get. The default Size value is 1024. If a password is required to read from the file, it can be set with the Password parameter.

Example

<webGetProfile File="/webplus/guestbook/guestbook.ini" Section="Message" Key="LastLine" Result=#numlines# Password="webplus">

<webPrint>

There are #numlines# lines in the guestbook.

</webPrint>

Web+ Output:

There are 2 lines in the guestbook.

<webPutProfile>

This command adds a new value to an existing key, or creates a new key with the specified value.

<webPutProfile File=FileName Section=SectionName Key=KeyName Result=#value# Password=ReadPassword>

File is the file name of the .INI to be written to (and is subject to the logical path names specified in the FILE I/O section of webpsvr.ini), Section is the section name that the key should be found in (if it exists) and Key is the name of the key itself. Result is the value that will be assigned to the Key. If a password is required to write to the file, it can be set with the Password parameter.

Example

<webSet #s# = #"<font size=-1>" & CurrentDateTime() & " : </font>Web+: This is a test message."#>

<webPutProfile File="/webplus/guestbook/guestbook.ini" Section="Message" Key="3" Result=#s# Password="webplus">

<webPutProfile File="/webplus/guestbook/guestbook.ini" Section="Message" Key="LastLine" Result="3" Password="webplus">

 

Chapter 16

E-Mail Integration

 

web_ChkMail Tag

This is an example of web_CustomTag. This tag will contact the mail server (IMAP server) to get the total emails and new emails in a particular user's inbox.

<web_ChkMail Name=... IMAPHost=... Port=... UserID=... Password=...>

Example

<web_ChkMail Name="test" IMAPHOST="mailhost.fiu.edu"

UserID="mingz"

Password=secret>

<webPrint>

<webIf #test.result#>

Total Email=#test.TotalEmail#<br>

New Emails=#test.NewEmails#<br>

<webElse>

Error in Checking Emails<BR>

#Error.ErrorMsg#<BR>

</webIf>

</webPrint>

Web+ Output:

Remark In order to run the above sample, you need to add the following into

webpsvr.ini's [Custom Tag] section.

-----------------------------------------------

TagName4=ChkMail

DllPath4=c:\ztemp\chkmail.dll

FuncName4=chkMail

 

Sending Mail From a Web+ Script

Web+ has the ability to send SMTP mail from within a script. This is done with the <webMail> command.

<webMail To=Recipient [From=Sender] [Subject=Subject] [Cc=CarbonCopyEmailAddresses] [Attach=filename] [SendMode={Text|Binary}] [Type=Type] [Query=QueryName] [MaxRows=MaximumQueryRows] [Group=SetOfRecords] [Server=SMTPServerType] [Port=TCP/IPPort] [TimeOut=NumberSeconds]>

</webMail>

The To parameter is the only required parameter for <webMail>, and it specifies the address to which the e-mail will be sent. The body of the e-mail should go between the opening and closing <webMail> tags. The rest of the parameters are all optional:

Parameter

What it Indicates

From

Indicates who the mail is from.

Subject

Defines the subject of the e-mail.

Cc

A comma separated list of e-mail address to send carbon copies to.

Attach

The filename of an attached file.

SendMode

The send mode for the e-mail, either "Text" or "Binary". The default is "Text".

Type

This indicates the type of content being sent. Currently, the only valid value for this is "HTML" indicating that the e-mail message contains HTML tags that need to be parsed and is only useful to e-mail clients that support HTML tags.

Query

This is the name of the database query from which data should be drawn to include in the e-mail. If multiple rows have been selected from the database, several copies of the e-mail will be sent.

MaxRows

This indicates the maximum number of rows to return from the database query, effectively limiting the number of e-mails sent.

Group

Specifies which query column to use in grouping sets of records together.

Server

The address of the SMTP server to use for sending e-mail.*

Port

The TCP/IP port on which the SMTP server is listening for requests, usually 25.*

TimeOut

The number of seconds to wait before terminating the connection on the SMTP server.*

* : These settings override the default Web+ settings.

Example

<webMail To="admin@domain.com">

This is a simple message with very few parameters.

</webMail>

Example

<webSet #custEmail# = "customer@domain.com">

<webMail To=#custEmail# From="info@TalentSoft.com" Subject="Web+">

Thank you for using Web+.

</webMail>

Invoking Web+ email from other applications : Web+ mail API

Integrating Web+ email delivery using API (the ability to call Web+ to send email from other programs).

Now you can define:

WebpMailPort=...

in webpsvr.ini's Main section. The default value is 6028.

The debug and release libraries for emailAPI are: actemailD.lib, actemail.lib and actemail.h. These should be found in a lib directory when web+ installed (or the bin directory).

We may need to change web+ admin a little bit to allow settting of WebpMailPort?

 

The prototype is of:

int sendEmail(char *hostIP, int serverPort, char *from, char *to, char *cc, char *subject, char *attach, int mode, char *body)

HostIP is the machine's IP address running web+ server,

ServerPort is the port number of web+ external service. Now we predefined it as 6028.

===File1:====sendemail.cpp =============================

#include <stdio.h>

#include "actemail.h"

void main(int argc, char *argv[])

{

if(argc != 2)

{

printf("Usage: actemail hostname\n");

printf("Example: actemail thunder.pacificnet.com\n");

} else

{

if(sendEmail(argv[1], EXTERN_PORT, "Tonyt", "tonyt@goweb.net", "",

"testing", "", 0, "Hi, Hello, Hello\n"))

{

printf("Email Sending succeeded\n");

} else printf("Sending email failed\n");

}

}

 

====File 2 =====sendemail.mak==============================

 

 

# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20

# ** DO NOT EDIT **

 

 

# TARGTYPE "Win32 (x86) Console Application" 0x0103

 

 

!IF "$(CFG)" == ""

CFG=sendemail - Win32 Debug

!MESSAGE No configuration specified. Defaulting to sendemail - Win32

Debug.

!ENDIF

 

 

!IF "$(CFG)" != "sendemail - Win32 Release" && "$(CFG)" !=\

"sendemail - Win32 Debug"

!MESSAGE Invalid configuration "$(CFG)" specified.

!MESSAGE You can specify a configuration when running NMAKE on this

makefile

!MESSAGE by defining the macro CFG on the command line. For example:

!MESSAGE

!MESSAGE NMAKE /f "sendemail.mak" CFG="sendemail - Win32 Debug"

!MESSAGE

!MESSAGE Possible choices for configuration are:

!MESSAGE

!MESSAGE "sendemail - Win32 Release" (based on\

"Win32 (x86) Console Application")

!MESSAGE "sendemail - Win32 Debug" (based on "Win32 (x86) Console

Application")

!MESSAGE

!ERROR An invalid configuration is specified.

!ENDIF

 

!IF "$(OS)" == "Windows_NT"

NULL=

!ELSE

NULL=nul

!ENDIF

######################################################################

# Begin Project

CPP=cl.exe

RSC=rc.exe

!IF "$(CFG)" == "sendemail - Win32 Release"

# PROP BASE Use_MFC 0

# PROP BASE Use_Debug_Libraries 0

# PROP BASE Output_Dir "Release"

# PROP BASE Intermediate_Dir "Release"

# PROP BASE Target_Dir ""

# PROP Use_MFC 0

# PROP Use_Debug_Libraries 0

# PROP Output_Dir "Release"

# PROP Intermediate_Dir "Release"

# PROP Target_Dir ""

OUTDIR=.\Release

INTDIR=.\Release

ALL : "$(OUTDIR)\sendemail.exe"

CLEAN :

-@erase "$(INTDIR)\sendemail.obj"

-@erase "$(OUTDIR)\sendemail.exe"

"$(OUTDIR)" :

if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D

"_CONSOLE" /YX /c

# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX

/c

CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\

/Fp"$(INTDIR)/sendemail.pch" /YX /Fo"$(INTDIR)/" /c

CPP_OBJS=.\Release/

CPP_SBRS=.\.

# ADD BASE RSC /l 0x409 /d "NDEBUG"

# ADD RSC /l 0x409 /d "NDEBUG"

BSC32=bscmake.exe

# ADD BASE BSC32 /nologo

# ADD BSC32 /nologo

BSC32_FLAGS=/nologo /o"$(OUTDIR)/sendemail.bsc"

BSC32_SBRS= \

LINK32=link.exe

# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386

# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386

LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib\

advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\

odbccp32.lib /nologo /subsystem:console /incremental:no\

/pdb:"$(OUTDIR)/sendemail.pdb" /machine:I386

/out:"$(OUTDIR)/sendemail.exe"

LINK32_OBJS= \

"$(INTDIR)\sendemail.obj" \

".\actemail.lib"

"$(OUTDIR)\sendemail.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)

$(LINK32) @<<

$(LINK32_FLAGS) $(LINK32_OBJS)

<<

!ELSEIF "$(CFG)" == "sendemail - Win32 Debug"

# PROP BASE Use_MFC 0

# PROP BASE Use_Debug_Libraries 1

# PROP BASE Output_Dir "Debug"

# PROP BASE Intermediate_Dir "Debug"

# PROP BASE Target_Dir ""

# PROP Use_MFC 0

# PROP Use_Debug_Libraries 1

# PROP Output_Dir "c:\ztemp"

# PROP Intermediate_Dir "c:\ztemp"

# PROP Target_Dir ""

OUTDIR=c:\ztemp

INTDIR=c:\ztemp

ALL : "$(OUTDIR)\sendemail.exe"

CLEAN :

-@erase "$(INTDIR)\sendemail.obj"

-@erase "$(INTDIR)\vc40.idb"

-@erase "$(INTDIR)\vc40.pdb"

-@erase "$(OUTDIR)\sendemail.exe"

-@erase "$(OUTDIR)\sendemail.ilk"

-@erase "$(OUTDIR)\sendemail.pdb"

"$(OUTDIR)" :

if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D

"_CONSOLE" /YX /c

# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D

"_CONSOLE" /YX /c

CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D

"_CONSOLE"\

/Fp"$(INTDIR)/sendemail.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c

CPP_OBJS=c:\ztemp/

CPP_SBRS=.\.

# ADD BASE RSC /l 0x409 /d "_DEBUG"

# ADD RSC /l 0x409 /d "_DEBUG"

BSC32=bscmake.exe

# ADD BASE BSC32 /nologo

# ADD BSC32 /nologo

BSC32_FLAGS=/nologo /o"$(OUTDIR)/sendemail.bsc"

BSC32_SBRS= \

LINK32=link.exe

# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

odbc32.lib odbccp32.lib /nologo /subsystem:console /debug

/machine:I386

# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug

/machine:I386

LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib

comdlg32.lib\

advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\

odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes\

/pdb:"$(OUTDIR)/sendemail.pdb" /debug /machine:I386\

/out:"$(OUTDIR)/sendemail.exe"

LINK32_OBJS= \

"$(INTDIR)\sendemail.obj" \

".\actemail.lib"

"$(OUTDIR)\sendemail.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)

$(LINK32) @<<

$(LINK32_FLAGS) $(LINK32_OBJS)

<<

!ENDIF

.c{$(CPP_OBJS)}.obj:

$(CPP) $(CPP_PROJ) $<

.cpp{$(CPP_OBJS)}.obj:

$(CPP) $(CPP_PROJ) $<

.cxx{$(CPP_OBJS)}.obj:

$(CPP) $(CPP_PROJ) $<

.c{$(CPP_SBRS)}.sbr:

$(CPP) $(CPP_PROJ) $<

.cpp{$(CPP_SBRS)}.sbr:

$(CPP) $(CPP_PROJ) $<

.cxx{$(CPP_SBRS)}.sbr:

$(CPP) $(CPP_PROJ) $<

######################################################################

# Begin Target

# Name "sendemail - Win32 Release"

# Name "sendemail - Win32 Debug"

!IF "$(CFG)" == "sendemail - Win32 Release"

!ELSEIF "$(CFG)" == "sendemail - Win32 Debug"

!ENDIF

######################################################################

# Begin Source File

SOURCE=.\sendemail.cpp

DEP_CPP_SENDE=\

".\actemail.h"\

 

"$(INTDIR)\sendemail.obj" : $(SOURCE) $(DEP_CPP_SENDE) "$(INTDIR)"

# End Source File

######################################################################

# Begin Source File

SOURCE=.\actemail.lib

!IF "$(CFG)" == "sendemail - Win32 Release"

!ELSEIF "$(CFG)" == "sendemail - Win32 Debug"

!ENDIF

# End Source File

# End Target

# End Project

######################################################################

 

 

 

 

 

 

 

 

 

 

Chapter 17

Web+ Custom Tags

What is a Custom Tag?

Syntactically, Custom Tags are XML compliant custom markup language elements that allow developers to build reusable components that can be easily dropped into a dynamic Web application. These tags are processed by the Web+ server, and can dynamically generate and execute client and server-side code. Custom Tags can be written in C/C++.

What kinds of things can be built using Web+ Custom Tags?

Because Custom Tags are a very general component architecture for Web+, they can be used to solve a huge range of programming problems. Custom Tags can be used to provide a tag-based wrapper around anything in the Web+ universe – including client-side HTML, Java and JavaScript, all of Web+’s native server-side interfaces (QUERY, LDAP, POP, etc.), and any external server-side code (through HTTP, OBJECT and Web+ API). Common uses of Custom Tags will include the following:

Utilities and Functions. Custom Tags can be used to solve very common programming problems, like converting text from upper case to lower case, formatting text inputs, doing more complex functions, etc. Developers can also build tags that are mini utilities for Web+ development. For example, a tag is available to read in and check the Web+ error log.

Dynamic User-Interface Components. One the most exciting uses of Custom Tags, it is incredibly easy and powerful to wrap up complex client-side capabilities with a tag-based interface. For instance, you could use Dynamic HTML (client-side JavaScript) to build a drag-and-drop animation control that a developer could put on their page with a simple tag. Or, you can wrap Web+, JavaScript and HTML together to create "intelligent form controls". This will make it possible for Web developers to take advantage of technology that has historically been difficult for them to implement and maintain.

Business Rules Components. Another common use, Custom Tags can drive and respond to business rules. For instance, it would be easy to create a web_ChkMail tag.

Application APIs. Companies building commercial applications with Web+, will want to use Custom Tags to create "Tag-based APIs" for their applications, enabling other Web+ developers to take advantage of their own applications through custom SDKs and programming kits.

How will using Custom Tags help facilitate rapid development within teams of Web developers?

As a component architecture, Custom Tags provide a foundation for reuse and abstraction that makes rapid, team-based development a reality for the Web platform. Custom Tags help provide a bridge between designers, HTML developers, Web+ and JavaScript developers, and low-level coders (C/C++). By creating a common language environment that can be used throughout these diverse teams, Custom Tags are one of the first technologies that promise to make teams of Web developers more productive in their development efforts.

 

Building custom tags in Web+.

 

The Web+ Application Programming Interface is a C++(C) based API

for creating custom tags. These custom tags are implemented as DLLs

for NT(Win95) or dynamic loading library(.so) for Unix platforms.They

have the following capabilities:

The ability to handle any number of custom parameters.

The ability to generate Web+ queries for interfacing with

non-ODBC based information sources.

The ability to dynamically generate HTML to be returned to

the client.

The ability to set variables within the Web+ application page

from which they are called.

1. Web+ Application Programming Interface APIs

All the APIs are defined in file "webpapi.h"

1.1 Custom parameter related APIs

You need to use custom parameter related APIs to get and set

parameter's value.

1.1.1 Get the length of a parameter's value

API: webpGetLengthOfParamValue(pwebpEnv,paramName)

Example:

For custom tag <web_Print ... Text=#Buffer# Status=#Ret# byref>,

you can use the following code to get the length of the value in

#Buffer#:

---------------------------------------------------------------

int len = webpGetLengthOfParamValue(webpEnv, "Text");

if(len >= 0) // Parameter Text exist

{

char *text = new char[len+1];

if(!text) return;

rt = webpGetParamValue(webpEnv, "Text", text, len+1);

if(!rt) // Failed to get the value of parameter:Text

{

delete[] text;

return 0;

}

}

---------------------------------------------------------------

1.1.2 Get the value of a parameter

API: webpGetParamValue(pwebpEnv,paramName, value, sizeOfvalue)

Example: see the example for webpGetLengthOfParamValue.

1.1.3 Set the value of a parameter

API: webpSetParamValue(pwebpEnv,paramName, value)

Example:

webpSetParamValue(webpEnv, "Status", "0");

Remark: You can use this API to alter the value of a parameter.

The caller's variable will also be changed only if it is passed

by "byref".

1.2 Get and Set the the value for caller's variables

1.2.1 Get the length of the value for the caller's variable

API: webpGetLengthOfVarValue(pwebpEnv,varName)

Example:

To get the length of the value of the caller's variable #FirstName#

------------------------------------------------------------

int len = webpGetLengthOfVarValue(webpEnv,"FirstName");

if(len >= 0) // Get the length successfully

{

char *text = new char[len+1];

if(!text) return;

rt = webpGetVarValue(webpEnv, "FirstName", text, len+1);

if(!rt) // Failed to get the value of FirstName

{

delete[] text;

return 0;

}

}

------------------------------------------------------------

1.2.2 Get the value for the caller's variable

API: webpGetVarValue(pwebpEnv,varName, value, sizeOfvalue)

Example: see the example for webpGetLengthOfVarValue.

1.2.3 Set the value for the caller's variable

API: webpSetVarValue(pwebpEnv,varName, value)

Example:

int rt = webpSetVarValue(webpEnv, "FirstName", "David");

if(rt) // set succeded

{

...

} else // failed

{

...

}

1.3 Send HTTP data to the client

1.3.1 Send text data to the client

API: webpSendHttpText(pwebpEnv, text)

Example:

if(!webpSendHttpText(webpEnv, "<BR>This is a reply from a DLL function<BR>\n"))

{

return 0;

}

 

1.3.2 Send binary data to the client

API: webpSendHttpData(pwebpEnv, Data, bytesOfData)

Example:

char buffer[1024];

// codes to fillup buffer

if(!webSendHttpData(webpEnv, buffer, 1024))

{

return 0;

}

1.4 Build custom query object

You can build a custom query object by using Web+ APIs and use it the same way as you

use other ordinary query object in your Web+ script file

1.4.1 Create custom query object

This is the first step to build a custom query object.

API: webpCreateQuery(pwebpEnv, queryName, numberOfFields)

Example:

To create query object named "CustomQuery" with 3 fields

HWEBPQUERY qhandle;

qhandle = webpCreateQuery(webpEnv, "CustomQuery", 3);

if(!qhandle) return 0;

1.4.2 Define the query object's field name

Every custom field should have a name just like the ordinary SQL query. So you can

refer to them in Web+ script file

API: webpSetFieldName(pwebpEnv, qhandle, column, name)

Example:

int rt = webpSetFieldName(webpEnv, qhandle, 1, "City");

if(!rt) return 0;

rt = webpSetFieldName(webpEnv, qhandle, 2, "State");

if(!rt) return 0;

rt = webpSetFieldName(webpEnv, qhandle, 3, "ZipCode");

if(!rt) return 0;

1.4.3 Add a new row to the query object

API: webpCreateNewRow(pwebpEnv, qhandle)

Example:

HWEBPROW rowhandle;

rowhandle = webpCreateNewRow(webpEnv, qhandle);

if(!rowhandle) return 0;

int rt = webpSetCellValue(webpEnv, rowhandle, 1, "Miami");

if(!rt) return 0;

rt = webpSetCellValue(webpEnv, rowhandle, 2, "FL");

if(!rt) return 0;

rt = webpSetCellValue(webpEnv, rowhandle, 3, "33174");

if(!rt) return 0;

1.4.4 Set the field data for a row

API: webpSetCellValue(pwebpEnv, rowhandle, column, value)

Example: see the example for webpCreateNewRow.

1.5 Set the query string for a query object

Set the query string so web+ can display it when needed.

API: webpSetQueryString(pwebpEnv, qhandle, queryString)

Example:

webpSetQueryString(webpEvn, qhandle, "Query from ......")

1.6 Set the query time for a query object

Set the query time so web+ can calculate it in total execution time.

API: webpSetQueryTime(pwebpEnv, qhandle, milliseconds)

Example:

webpSetQueryTime(webpEnv, qhandle. 123)

2 Compile web+ custom tags

On NT or Win95 platform. Web+ custom tag is of DLL. On unix platform, it is of

dynamic loading libary (.so)

2.3 Compile Web+ custom tag on NT by MFC4.2 or above

Include webpapi.h in all your source files using Web+ APIs, create a Project Workspace

of type MFC APP Wizard(dll) or Dynamic-Link Library, set the setting of the project

to use Multithreaded rumtime library.

2.4 Compile Web+ custom tag on Solaris or Linux

If you use GNU GCC compiler, we suggest you write your code in C. If you are sure that

your compiler and linker support making dynamic loading library for C++ program, you

can write the custom tags in C++. Please include webpapi.h in all your source files

using Web+ APIs. Following is an example make file to compile a custom tag file:

chkmail.so: chkmail.o

ld -G -o chkmail.so chkmail.o

chkmail.o: chkmail.cpp

gcc -c -x c chkmail.cpp

3 Install Web+ custom tags

In order to use a web+ custom tag, you need to properly install it so that Web+ server

knows about it. To install a custom tag:

a). Load the Web+ Server Manager through web browser

b). Goto "Custom Tags" section

c). In Tag Name box, give the name you want to call your custom tag.

d). In DLL Path, give the fullpath where you put your custom tag's

DLL file (or .so file).

e). In Function Name, type in the entry function's name Web+ server

will first call. For example, if you defined an Web+ entry function

as:

WEBPLUS_PUBLIC VOID myPuts(HWEBP *webpEnv) {

...........

}

the function name is: myPuts

4 Useful web+ custom tags

4.1 Web_ChkMail

4.2 Web_Print

4.3 Web_QueryIpHostName

 

 

Chapter 18

COM/DCOM integration

Integrating Objects in Web+ scripts

There are a lots of ways of getting Objects or create from scratch. After registering and getting ProgID, one could easily follows the folowing syntax.

Syntax <webObject ProgID=… AS=… Local=… ServerType=… >

ProgID required. OLE(COM) object’s ProgID.

As required. The name Web+ will be used to communicate with that object.

Local not required. Reflects the local conventions and language for a particular geographical region.

Default is English.

ServerType required. Define the type of the OLE(COM) object. Can be Server type:

"InProc" , "Local" , "Remote"

 

Web+ extended the syntax of <webObject ...> a little to include

another attribute:

ServerType=...

It can be value of "INPROC", "LOCAL" and "REMOTE".

Example <WebObject ProgID="Excel.Application" As="test">

<WebSet #test.visible# = 0>

<webSet #y#=#test.checkspelling("ddd")#>

<WebSet #x# = #test.quit()#>

<webPrint>

Start Exel, hide it, then Quit<BR>

<webIf #y#>

Correct word<BR>

<webElse>

Not in Dictionary<BR>

</webIf>

</webPrint>

 

 

Chapter 19

Crystal Report integration

Using webReport to integrate custom crystal report

The webreport tag shows crystal report files on web browser if Crystal Reports Engine (CRPE32.DLL) has been installed in SYSTEM32 directory of your PC.

Web+ 4.0 allows tremendous flexibility in the runtime customization of Crystal Report, including the ability to dynamically set the selection formula, sort order, target data source, and any custom formula withina report. The parameters you set in the webReport tag take precedence over those the report file.

Syntax <webReport Report=... UrlBase=... DirForUrlBase=... Datasource=...

OrderBY=... @formular1=... @formular2=... ...

@formularn=... >

query statement

</webReport>

Example <webReport report="/student.rpt">

{STUDENT.last_name} IN "Naboulsi" and {STUDENT.birth_year} > 1969

</webReport>

 

 

Chapter 20

Encryption

Encrypting Web+ Scripts Using wmlencode.exe

The purpose of the file is to encript source code from end users for the commercial reason.

The general syntax is:

wmlencode [-r] source [destination]

-r means recursively encrypt files under the subdirectory.

source can be: xyz.wml, *.wml, dir/*.wml

destination can be: uvw.wml, *.xyz, directory

If the source and destination directory is different, Web+ will encode the

files in source and write them to destination with the same file names. If

they are the same directory, web+ will use "ewm" as the extension.

 

General encryption Using webPGP

PGP means Pretty Good Privacy.

The general syntax is:

General format:

<webPGP Action="Encrypt" FromFile=FromFile FromPassword=Password>

or

<webPGP Action="AddKey" Key=Key >

To do encryption, use this format:

<webPGP Action="Encrypt"

{FromFile=FromFile | FromText=TextString }

{ToFile=ToFile | ToVar=ToVar }

UserIDs=UserID FromPassword=FromPassword ToPassword=ToPassword>

To do decryption, use this format:

<webPGP Action="Decrypt"

FromFile=FromFile

PassPhrase=#Password#

ToVar=#Varible#

Ret=#Num# >

To do Sign, use this format:

<webPGP Action="Sign"

FromFile=FromFile

UserID=#ID#

PassPhrase=#Password#

ToVar=#Varible#

Ret=#Num# >

Example :

<webPGP Action="Encrypt" FromText="Hello" ToVar=#XY# UserIDs="Ming" Ret=#OK#>

<webIf #OK#>

<webPrint> #XY#<BR> </webPrint>

</webIf>

<webPGP Action="Encrypt" FromFile="/test.txt" ToFile=#XY# UserIDs="Ming" FromPassword="read" ToPassword="write" Ret=#OK#>

<webIf #OK#>

<webPrint> #XY#<BR> </webPrint>

</webIf>

-------------------------------------------------

<webPGP Action="Decrypt" FromFile="/test.pgp" PassPhrase="mingz"

ToVar=#XY# Ret=#OK#>

<webIf #OK#>

<webPrint>

#XY#<BR>

</webPrint>

</webIf>

-------------------------------------------------

<webPGP Action="Sign" FromFile="/test.txt" UserID="mingz"

PassPhrase="mingz" ToVar=#XY# Ret=#OK#>

<webIf #OK#>

<webPrint>

#XY#<BR>

</webPrint>

</webIf>

 

 

 

Chapter 21

Microsoft Visual InterDev integration

 

Features/Benefits of Integrating Microsoft Visual InterDev with Web+

There are many features and benefits of using Microsoft Visual InterDev as an integral part of the application development environment at TIM. These can be grouped into 4 main benefit groups and are as follows:

1) Increased Teamwork

Microsoft FrontPage™ automatically integrates with Visual InterDev, making it very easy for developers and artists who use FrontPage to integrate seamlessly into the proposed environment.

Visual InterDev uses the HTTP protocol to communicate between clients and servers, resulting in easier integration of telecommuting developers with the rest of the development team.

Microsoft Visual SourceSafe™, when integrated with Visual InterDev, will protect files from being opened by more than one developer at a time, allowing more efficient scalability of development teams.

2) Better Website/Application File Management

Visual InterDev’s Server Master Copy/Local Working Copy file architecture allows developers to work on local copies of files for development and testing before "releasing" it to the server for access by others.

A Visual InterDev client can be easily configured to automatically update the server copy each time the local copy is modified, regardless of the application used to modify the file.

Visual SourceSafe also will assist with file versioning by managing different versions of files automatically.

3) Seamless Support for Different File Types

HTML files and Web+ script files can co-exist in the same directory, eliminating the confusion resulting from having incompatible root directories (this benefit isn’t really a result of integrating Web+ with Visual InterDev, since it is this that actually allows Visual InterDev to integrate with Web+).

Visual InterDev, as being a part of the Microsoft Visual Studio, allows seamless integration of Visual Basic, Active Server Pages, Visual C++, Visual J++, etc. files with Web+ web-based applications. This allows the object-oriented/reusable components nature of these file types to be used in web-based application development.

4) Increased Security

Visual InterDev has built in security options that can restrict actions that various developers will be permitted to perform, ranging from full site administration, to read-only. These permissions are unique to each website/application.

Better version tracking with Microsoft Visual SourceSafe installed, allowing administrators to review who made changes to each file and which changes were made.

 

Procedures for Integrating Microsoft Visual InterDev and Web+

Below is a step-by-step procedure that will install the Microsoft Visual InterDev with TalentSoft Web+ in one seamless developing environment. The steps below are designed to minimize server downtime and ensure data integrity. Though variations on the below procedure will yield similar results, it is recommended to follow the below procedure exactly.

1) VERY IMPORTANT: Read and understand all instructions before proceeding

2) Copy the \webplus directory (the one that contains the bin directory) to a location outside of the HTML directory structure (if it is inside the HTML directory structure)

3) Copy the \webplus\script directory to the HTML root directory

4) Move all .wml files, databases, etc. from the new copy of the script directory (from Step 2) to a location inside their corresponding HTML files’ directories. The result of this will be that all files associated with a website/application will be in 1 root directory contained in the HTML root directory. Any filename conflicts must be resolved here.

5) Reconfigure the ODBC datasources (in the Control Panel/ODBC applet) to the new locations inside the HTML directory structure (from Step 3)

6) Open the \winnt\webpsvr.ini file.

7) Change the appropriate paths in the webpsvr.ini file to their new location (from Steps 2 and 4). Make sure that all paths reflect the files’ new locations.

8) If .wml files have not been document type mapped for the Microsoft web server, then follow these instructions:

Copy the webplus.dll file from \webplus\bin to the web server’s physical /cgi-bin directory

Stop the web server service

Run the \webplus\bin\iisreg.exe utility by entering into the command line with an argument equal to the full path name of the webplus.dll file and the physical cgi-bin directory it was copied to. Example: iisreg c:\inetsrv\scripts\webplus.dll

Start the web server service

In the webpsvr.ini file, change the WebpURL key (in the [Main] section) to the logical path of the webplus.dll file. Example: WebpURL=/cgi-bin/webplus.dll

9) Save and close the webpsvr.ini file.

10) Stop the TalentSoft Web+ service.

11) Start the TalentSoft Web+ service. This will refresh the Web+ server to the new values in the webpsvr.ini file.

12) Test the changes.

13) If the new changes have been successfully tested, delete the \webplus\script directory.

14) Install Microsoft Visual InterDev onto the workstations and Microsoft Visual SourceSafe (optional) onto the servers

15) Now, Microsoft Visual InterDev will be able to fully access the TalentSoft Web+ files.

 

 

Chapter 22

Integration With Other Applications

External File Execution

The <webRun> command allows a script file to call an external executable. This function can be completely disabled by setting WebRunEnabled=0 in webpsvr.ini.

<webRun Exe=CommandLine [Type={Win32|Win16}] [InPara=InputParameter] [OutVar=#OutputVariable#] [TimeOut=NumSeconds] [Password=webRunPW]>

The only required parameter for <webRun> is Exe. This will be the command, and optional command line arguments, of the executable file that <webRun> will execute. The path to the executable is absolute. The rest of these parameters are optional.

The type of application to be executed can be set with the Type parameter. This can be either Win32 or Win16 to indicate either a 32 bit or 16 bit application. If there are any input parameters to be passed to the executable, they can be set with the InPara parameter. Likewise, if an application outputs any data, it will be stored in the variable set with the OutVar parameter. TimeOut is the length of time, in seconds, to wait for the executable to finish before finishing and closing the script file. Password is the <webRun> password, specified in webpsvr.ini. If the password does not exist, none is required.

Example

<webRun Exe="mem.exe" OutVar=#Result# Password="webRunpassword" TimeOut=10>

<pre><webPrint>#Result#</webPrint></pre>

Web+ Output:

655360 bytes total conventional memory

655360 bytes available to MS-DOS

635552 largest executable program size

1048576 bytes total contiguous extended memory

0 bytes available contiguous extended memory

931840 bytes available XMS memory

MS-DOS resident in High Memory Area

 

Dynamic Linked Libraries

Web+ has the ability to call functions embedded in Dynamic Linked Libraries (DLLs) with the use of the <webDLL> command.

<webDLL FunctionName=dllFunctionName LibraryName=dllFilename Password=DLLPassword [retVar=#r#]>

The FunctionName parameter specifies the name of the DLL function to call, and LibraryName specifies the file name of the DLL itself. If a webDLL password has been specified in the webpsvr.ini file, then it must follow the Password parameter. If the operation is successful, retVar will be set to 1.

Example

This example will use the hypothetical mytest.dll, source code for this .DLL follows. The example Web+ script will call the DLL, which in turn will output a line of HTTP text and then set a variable.

<webSet #DllVar# = "Empty">

<webPrint>

DllVar before DLL function: #DllVar#

</webPrint>

<webDLL FunctionName="myPuts"

LibraryName="c:\webplus\script\mytest.dll"

Password="webrunpassword">

<webPrint>

DllVar after DLL functions: #DllVar#

</webPrint>

Web+ Output:

DllVar before DLL function: Empty

This is a reply from a DLL function

DllVar after DLL functions: This value is set by a DLL function

Source code for mytest.dll.

#include <windows.h>

#include "webpapi.h"

WEBPLUS_PUBLIC VOID myPuts(HWEBP *webpEnv) {

webpSendHttpText(webpEnv, "<BR>This is a reply from a DLL function<BR>\n");

webpSetVarValue(webpEnv, "DllVar", "This value is set by a DLL function");

}

Webpapi.h is a header for the Web+ functions which is included with Web+. It can be found in the c:\webplus\bin directory.

 

Communication via Sockets

What Are Sockets?

Sockets are the interfaces by which an application communicates with another host machine. In order for Web+ scripts to communicate with another machine, there must be an open socket to communicate through.

What Are Ports?

Ports are numbers associated with various protocols used for transferring information from one machine to another. By specifying a port number, the remote machine knows which protocol to use to respond to queries. Here is a list of some common port numbers and their associated protocols:

Port Number

Protocol

7

Echo

21

File Transfer

23

Telnet

25

Simple Mail Transfer (SMTP)

79

Finger

80

Hypertext Transfer (HTTP)

Opening a Socket

To open a socket for exchanging information, the <webSocketOpen> command must first be issued.

<webSocketOpen Name=SocketName Host=DomainName Port=Port [Result=#Result#] [TimeOut=NumberSeconds]>

<webSocketOpen Name=SocketName Host=DomainName:Port [Result=#Result#] [TimeOut=NumberSeconds]>

The Name of this socket will be the handle used to refer to this particular socket for future socket calls. The Host is the domain name, or IP address, of the computer with which the socket should be opened. Port indicates which port number, or protocol type, that should be used to communicate. The Result and TimeOut parameters are optional. If the socket is successfully opened, Result will be set to 1, otherwise it will be 0. If the socket should closed after a specified amount of time, that can be set with the TimeOut parameter. This overrides the time out setting in webpsvr.ini.

Interacting With a Socket

To send a line of text to the opened socket, the <webSocketSend> command must be used. To get a line of text from the opened socket, the <webSocketReceive> command must be used.

<webSocketSend Socket=SocketName Text=OutputText [Result=#Result#]>

<webSocketReceive Socket=SocketName Text=#Text# [Result=#Result#]>

The Socket parameter is the handle given to this socket by the previous <webSocketOpen> command. Text is either the data to be sent to the socket, or the variable into which received data will be put. It’s important to note that in most instances, out bound text should be appended with the standard End Of Line character string: "&Chr(13)&Chr(10)". If the socket command is successful, Web+ will set the Result variable to 1, otherwise it will be set to 0.

Closing a Socket

After all socket calls are finished, the socket should be closed. If a socket is not closed in this manner, it will usually be timed-out by the server.

<webSocketClose Socket=SocketName [Result=#Result#]>

The Socket parameter indicates which socket will be closed. If the socket is successfully closed then the Result variable will be set to 1, otherwise it will be 0.

Example

<webSet #EndOfLine# = #Chr(13) & Chr(10)#>

<webSocketOpen Name=MySocket Host="search.yahoo.com:80" Result=#ret#>

<webIf #ret#>

<webSocketSend Socket=MySocket Text=#"GET /bin/search?p=talentsoft" & EndOfLine# Result=#ret#>

<webWhile #ret#>

<webSocketReceive Socket=MySocket Text=#text# Result=#ret#>

<webPrint>#text#</webPrint>

<webIf #InStr(1, text, "</HTML>", 0)#>

<webSet #ret# = 0>

</webIf>

</webWhile>

</webIf>

<webSocketClose Socket=MySocket>

This example will open a socket to search.yahoo.com on port 80, the HTML protocol, and send a GET command with a search on the word "talentsoft". Yahoo should return, on that socket, an HTML formatted page revealing the results of its search.

 

Section 4

Appendices

 

Appendix 1

Common Errors and Problems

To avoid common errors and problems in the execution and maintenance of Web+, follow these tips. If you encounter strange behavior or otherwise unexplained results, check these items, as well.

 

Appendix 2

Troubleshooting

Error

Solution

You receive a Web+ "Communication Error".

Verify that the TalentSoft Web+ Service is started in Control Panel | Services.

Web+ "ODBC data source not found" error.

The ODBC data source must be setup correctly. Verify that the data source is configured properly in the webpsvr.ini file. Also verify that the ODBC data source is correctly set as a System data source in Control Panel | Services. See the section on setting up ODBC data sources for more information.

Browsing http://localhost/cgi-bin/webplus.exe causes a "Save As…" dialog box saving webplus.exe to appear.

Launch Internet Service Manager, select the WWW server and go to Properties | Service Properties. Move to the "Directories" tab, highlight the /cgi-bin alias and select "Edit Properties…". At the bottom of the window, enable the "Execute" access setting and click "OK". (Note: the "Read" access setting should probably be disabled if it’s not already.) Click "OK" again, and exit the Internet Service Manager.

 

Appendix 3

Web+ Initialization Files

webpmsg.ini

All Web+ standard error and information messages are in the webpmsg.ini file (located in your active Windows directory). You may customize the messages as you wish.

;*********************************************************

;* FILE NAME: webpmsg.ini : Web+ Messages File

;* CORRESPONDING EXECUTABLE PROGRAM:

;* webpsvr.exe : Web+ Server executable version

;* or, webpsvc.exe : Web+ Server NT service version

;* DEFAULT PATH: Windows directory, eg: c:/windows, c:/winnt

;*

;* CREATED BY: TalentSoft Web+ Master

;* CREATED ON: 9/1/1995

;*

;* DESCRIPTION:

;* This initialization file contains all error and information

;* messages for Web+. Web+ was designed to be an open applicatio.

;* By providing all the messages as an external text file, Web+

;* gives users the maximum flexibility and customization ability.

;* You may customize your Web+ messages or translate all Web+

;* messages to other languages. If you do translate Web+ messages

;* to other languages, please let us know by sending an email to

;* info@TalentSoft.com and share with us your work.

;* Removing the comments in this file may improve Web+ speed.

;* Do NOT change this file unless you know know what you are doing!

;*

;* NOTE:

;* An initialization file is composed of at least a

;* section name and a key name with the following format:

;* [Section Name]

;* keyname=value

;* The quotes, double or single ("" or ''), around

;* the values are not required and do not affect results.

;*

;* COMMENT:

;* All comments should begin with a semicolon (;)

;* The variable names should not be case sensitive.

;*

;* MAINTENANCE LOG:

;* DATE ADDITION/MODIFICATION DESCRIPTION

;* -------- --------------------- ------------------

;* 09/01/95 webp_msg.ini Web+ 1.0 release

;* 06/01/96 webp_msg.ini Web+ 2.0 release

;* 10/01/96 webp_msg.ini Web+ 2.1 release

;* 12/16/97 webp_msg.ini Web+ 2.2 release

;* 02/16/97 rename to webpmsg.ini Web+ 3.0 release

;*******************************************************

[ErrorMsg]

;Show Web+ System Information, 1=yes, 0=no

ShowSystemInformation=1

;Each error message is divided into 3 sections: c=Code, e=Explanation, t=Troubleshooting

00000header=<HR><H2> Error(s) Encountered While Processing Your Request </H2><TABLE BORDER><TR><TD>

00000c=<H3>Web+ Error Message:</H3><P>

00000e=<H3>Explanation:</H3><P>

00000t=<H3>Troubleshooting Information</H3><P>

00000footer=</TD></TR></Table><p> Please inform the <a href="mailto:#AdminEmail__#">site administrator</a> that this error has occurred. Be sure to include the contents of this page in your message to the administrator. <HR>

;Missing Web+ script file argument

10000c=Missing Web+ script file argument.

10000e=For Web+ to process a script file, it must be passed as an argument.

10000t=Append the location and name of your script file to the submitted URL in the form: "http://www.domain.com/cgi-bin/webplus.exe?script=/logicalPath/filename.wml".

;Sever not responding

10010c=Web+ server application not available.

10010e=The Web+ server application is not currently running or is not correctly installed.

10010t=Make sure that the Web+ server is properly installed and running. The Web+ server executable (#EXEName#) must be running before attempting to submit requests to Web+.<P>Note: If the Windows NT service version of Web+ is being used, go to Control Panel | Services, and make sure that the "TalentSoft Web+ Server" service is started. If so, stop and re-start the service. If not, simply start the service.<P>Note: If the Windows NT service version of Web+ is not being used, the Web+ server application can be made more reliable by having it start automatically in the Windows 'Startup' folder.

;Incomplete form, missing required fields

10110c=Incomplete form - required fields missing.

10110e=There are required fields in the submitted form without data.<P>The following required fields are empty: #MissingFields#

10110t=Use the 'Back' button on the web browser to return to the previous page and enter data into the required form fields.

;Invalid integer type

10120c=Invalid integer type.

10120e=Only integers may be entered into the '#IntegerFieldName#' field. '#WrongTextEntered#' was entered.

10120t=Use the Back button on the web browser to return to the previous page and correct those fields.

;This error doesn't seem to be used. Web+ returns '10410: Database SQL SELECT Permission Denied' when an inaccessible datasource is referenced.

;ODBC data source not found

10020c=ODBC data source not found.<P>ODBC Error Code = IM002<P>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

10020e=Web+ cannot find the specified ODBC data source.

10020t=In order to use ODBC data sources with Web+, the data source must be created in webpsvr.ini manually, or via the ODBC section of the Web+ Server Administrator. If running under Windows NT, the data source must be created as a 'System DSN' in order for it to be available to Web+.<P>Web+ cannot find the following ODBC data source.<P>Data Source: '#CurDataSource__#'<P>Date/Time: #CurrentDateTime()#<P> Browser: #CGI.HTTP_User_Agent#<P>Remote Address: #CGI.Remote_Addr#<P>Query String: Script=#CurQueryName__#, #CurFileName__#, #CurTemplateName__#.

;ODBC fetch data error

10021c=ODBC fetch data error.

10021e=Web+ can not use ODBC's 'SQLFetch' command to get data from query result.

10021t=Please check the ODBC configuration and the webDbQuery SQL statement for correct syntax.

;ODBC API error

10022c=Calling ODBC API error.

10022e=Web+ can not call ODBC's API correctly.

10022t=Please make sure that the system supports ODBC and that it is configured correctly.

;ODBC EXE error

10023c=ODBC statement execution error.

10023e=Web+ can not correctly execute the ODBC statement.

10023t=Verify that the syntax of your SQL statement is correct.

;Exe error

10210c=External file run error.

10210e=The command line '#EXEFile#' could be either not be found or cannot be executed.

10210t= Verify the syntax and location of the command line.

;Script file error

10220c=Script file error.

10220e=The script file could not be executed because it could not be found or is corrupt.

10220t=Check the logical and physical paths for '#CurTemplateName__#' and make sure that it is in the right directory. Also verify the file's integrity.

;EMail error

10230c=Email delivery error.

10230e=The Mail server or the network may be down.

10230t=Check with the Web+ System Administrator to make sure that the SMTP mail server is connected and in operation.

;Divide overflow

10240c=Divide by zero error.

10240e=A number cannot by divided by zero or a number very close to zero.

10240t=Make sure the dividend of the operation is not zero.

;Logarithmic overflow

10250c=Logarithmic calculation overflow.

10250e=The argument of the logarithm is less than or equal to zero.

10250t=Make sure the argument in the logarithm is greater than zero.

;Exp Overflow

10251c=Exponential calculation overflow.

10251e=The argument of the exp() function is greater than the maximum value allowed (709.782712893).

10251t=Make sure the function's argument is less than the maximum value.

;File Error

10260c=File access error.

10260e=The file referenced could not be opened.

10260t=Verify that the file exists in the correct directory and that it is not corrupt.

;DataBase Operation Select Error

10410c=SQL SELECT permission denied.

10410e=You do not have the permission to perform SQL SELECT operations on this data source.

10410t=Verify that the ODBC datasource has been entered into the Web+ server configuration file (webpsvr.ini) and that the SQL_Select key is set to 1.

;DataBase Operation Write Error

10420c=SQL INSERT permission denied.

10420e=You do not have the permission to perform SQL INSERT operations on this data source.

10420t=Check with the Web+ System Administrator to gain proper permissions. Also check the [ODBC] section of the Web+ server configuration file (webpsvr.ini) and verify that the SQL_Insert key is set to 1.

;DataBase Operation Update Error

10430c=SQL UPDATE permission denied.

10430e=You do not have the permission to perform SQL UPDATE operations on this data source.

10430t=Check with the Web+ System Administrator to gain proper permissions. Also check the [ODBC] section of the Web+ server configuration file (webpsvr.ini) and verify that the SQL_Update key is set to 1.

;DataBase Operation Delete Error

10440c=SQL DELETE permission denied.

10440e=You do not have the permission to perform SQL DELETE operations on this data source.

10440t=Check with the Web+ System Administrator to gain proper permissions. Also check the [ODBC] section of the Web+ server configuration file (webpsvr.ini) and verify that the SQL_Delete key is set to 1.

;DataBase Operation Stored Procedure Error

10450c=SQL STORED PROCEDURE permission denied.

10450e=You do not have the permission to perform SQL STORED PROCEDURE operations on this data source.

10450t=Check with the Web+ System Administrator to gain proper permissions. Also check the [ODBC] section of the Web+ server configuration file (webpsvr.ini) and verify that the SQL_SP key is set to 1.

;File Path Error

10510c=Cannot find logical path.

10510e=The logical path may not be properly mapped to a physical path in webpsvr.ini.

10510t=Please check with the Web+ System Administrator to gain proper permissions. Check the [FILE IO] section of the Web+ server configuration file (webpsvr.ini) and verify that FileIOLogicalPath and FileIOPhysicalPath are properly defined.

;File Access Error

10520c=File read permission denied.

10520e=You do not have permission to read from this directory.

10520t=Check with the Web+ System Administrator to gain the proper permission. Check the [FILE IO] section of the Web+ server configuration file (webpsvr.ini) and verify that the FileRead key is set to 1 and that the FileReadPassword matches that in the script file.

10530c=File write permission denied.

10530e=You do not have permission to write to this directory.

10530t=Check with the Web+ System Administrator to gain the proper permission. Check the [FILE IO] section of the Web+ server configuration file (webpsvr.ini) and verify that the FileWrite key is set to 1 and that the FileWritePassword matches that in the script file.

;WebRun Error

10610c=Cannot issue a webRun command.

10610e=The webRun command has been disabled.

10610t=Set WebRunEnabled=1 in the [WEBRUN] section of the Web+ server configuration file (webpsvr.ini) to enable usage of the webRun command.

;WebDll Error

10611c=WebDLL has been disabled.

10611e=The webDLL function has been disabled by the Web+ Administrator, so now DLL functions may be used.

10611t=Set WebRunEnalbed=1 in the webpsvr.ini file.

;WebRun Password Error

10620c=Incorrect webRun password.

10620e=A webRun command was issued without the correct webRun password.

10620t=Verify that the password in the script is the same as that in the [WEBRUN] section of the Web+ server configuration file (webpsvr.ini).

;WebDll Password Error

10621c=Incorrect webDll password.

10621e=A webDll command was issued without the correct webDll password.

10621t=Verify that the webDll password in the script is the same as that in the [WEBRUN] section of the Web+ server configuration file (webpsvr.ini).

;File Read Password error

10650c=Incorrect file read password.

10650e=An incorrect password was used when trying to read from a file.

10650t=Verify that the password in the script is the same as that in the [FILE IO] section of the Web+ server configuration file (webpsvr.ini).

;File Write Password error

10660c=Incorrect file write password.

10660e=An incorrect password was used when trying to write to a file.

10660t=Verify that the password in the script is the same as that in the [FILE IO] section of the Web+ server configuration file (webpsvr.ini).

;webIniRefresh error

10710c=Incorrect Web+ ini reinitialization password.

10710e=An incorrect password was used when trying to reinitialize the Web+ server configuration file (webpsvr.ini).

10710t=Verify that the password in the script is the same as that in the [Admin] section of the Web+ server configuration file (webpsvr.ini).

;webIniGet error

10720c=Incorrect webIniGet password.

10720e=An incorrect password was used when trying to get a key's value.

10720t=Verify that the password in the script is the same as that in the [Admin] section of the Web+ server configuration file (webpsvr.ini).

;webIniPut error

10730c=Syntax error in webIniPut.

10730e=There was a syntax problem with the webIniPut command.

10730t=Verify the syntax in the webIniPut statement. The correct syntax of webIniPut is: WebIniPut (SectionName, Key, Value, Password).

;Variable not defined error

10810c=Variable not defined.

10810e=Cannot use the variable '#CurVarName__#' to do an operation without first assigning its value.

10810t=Check the script and make sure that the variable is properly defined before being used.

;File Name Empty

10910c=Empty File Name in webGetProfile.

10910e=The file parameter of the webGetProfile is empty.

10910t=Check the syntax of the webGetProfile command and verify that the ini file name is present.

;Database options disabled (where is this parameter set? -jarrin)

10920c=Database operations disabled.

10920e=Database operations have been disabled.

10920t=Check the [ODBC] section of the Web+ server configuration file (webpsvr.ini).

;Web+ Mail disabled

10930c=Web+ email disabled.

10930e=Email cannot be sent because it has been disabled.

10930t=Check the [SMTP] section of the Web+ server configuration file (webpsvr.ini).

;Expression syntax error

11010c=Syntax error.

11010e=There is a syntax error in an expression.

11010t=Please check the Web+ script and make sure that the variables and syntax are properly defined and written. The webplus.log can also be checked for warning or error messages.

;Temporary Logical Path Error

11020c=Can't create temp file.

11020e=A temporary file could not be created because the logical and physical pathes are not defined.

11020t=Define the logical and physical pathes for temp/ in the Web+ server configuration file (webpsvr.ini).

;Exceeding maximum users error

12010c=Maximum number of Web+ users reached.

12010e=The maximum number of concurrent Web+ users has been reached.

12010t=Reload this page to access Web+. Please ask the webmaster to contact <a href=http://www.TalentSoft.com>TalentSoft</A> so that the Web+ license can be upgraded to allow more concurrent Web+ users.

;Exceeds the maximum number of fields for a table or query

10240c=Maximum number of fields exceeded.

10240e=The number of fields inserted, updated or queried exceeds the maximum number (currently 1024) that Web+ can handle.

10240t=Redefine the table or query.

;Communication error

12020c=Invalid WebpServer password.

12020e=An incorrect, of missing password was used when trying to communicate between client and server.

12020t=Set the communication password to that which is specified as the WebpServerPassword.

;Web+ Server is out of date

12060c=Web+ server expired.

12060e=The Web+ license ID has expired.

12060t=Please contact <a href=http://www.talentinfo.com>Talent Information Management</a> for a new license ID.

;License ID Error

12070c=Invalid License ID.

12070e=There is something wrong with the License ID.

12070t=Verify that the License ID in the [Main] section of the Web+ server configuration file (webpsvr.ini). is exactly the same as the one that appears in your email. Contact <a href=http://www.TalentSoft.com>TalentSoft</a> if the problem persists.

;Script runtime error

12080c=Script runtime error.

12080e=There is something wrong syntactically or semantically with the script file: '#CurTemplateName__#'.

12080t=Verify that the syntax and semantics of the script file '#CurTemplateName__#' are correct.

;Conversion to Integer Error

12100c=String to integer conversion error.

12100e=Error trying to convert a non-integer string to an integer.

12100t=Verify that variable '#CurVarName__#' in the script file is a meaningful integer string.

;Array Index exceeds range limit

12120c=Array index out of range.

12120e=The index of the variable '#CurVarName__#' is out of range.

12120t=Verify that the array variable's index is within range.

;Illegal nested webPrint, webPrintTable or webMail in the tail part of a webPrint group field

12160c=WebPrint, webMail or webPrintTable misused with webPrint or webMail.

12160e=WebPrint, webMail and webPrintTable cannot be used within the tail part of webPrint or webMail when using a group parameter.

12160t=Remove the webPrint, webMail or webPrintTable command that is in the webPrint or webMail.

;Bad Domain Name, can not find its IP address

12200c=Bad host name for socket operation.

12200e=Web+ can not open a TCP/IP connection to the specified host.

12200t=Verify that the host name specified is correct and that the host is available.

 

webplus.ini

Web+ client configuration file.

;*********************************************************

;* FILE NAME: webplus.ini : Web+ Client Initialization File

;* CORRESPONDING EXECUTABLE PROGRAM:

;* webplus.exe : Web+ Client CGI executable version

;* or, webplus.dll : Web+ Client ISAPI version

;* DEFAULT PATH: Windows directory, eg: c:/windows, c:/winnt

;*

;* CREATED BY: TalentSoft Web+ Master

;* CREATED ON: 9/1/1995

;*

;* DESCRIPTION:

;* This initialization file contains important configuration

;* information about Web+ Client: webplus.exe (Web+ Client

;* CGI executable version) or webplus.dll (Web+ Client ISAPI version).

;* Removing the comments in this file may improve Web+ speed.

;* Do NOT change this file unless you know know what you are doing!

;*

;* NOTE:

;* An initialization file is composed of at least a

;* section name and a key name with the following

;* format:

;* [Section Name]

;* keyname=value

;* The quotes, double or single ("" or ''), around

;* the values are not required and do not affect results.

;*

;* COMMENT:

;* All comments should begin with a semicolon (;)

;* The variable names should not be case sensitive.

;*

;* MAINTENANCE LOG:

;* DATE ADDITION/MODIFICATION DESCRIPTION

;* -------- --------------------- ------------------

;* 09/01/95 ALL Web+ 1.0 release

;* 06/01/96 ALL Web+ 2.0 release

;* 10/01/96 ALL Web+ 2.1 release

;* 12/16/97 All Web+ 2.2 release

;* 02/16/97 All Web+ 3.0 release

;*******************************************************

[Main]

;Web+ Client/Server Communication method: Named Pipe (0), or Socket (1)

;If both the Web+ Client and Web+ Server are on the

; same machine, it is better to set to 0 for Named Pipe.

;If the Web+ Client and Web+ Server are on different machines

; (different IP addresses), you MUST set PipeOrSocket

; to 1 for TCP/IP Socket communications method.

PipeOrSocket = 0

;Web+ Server IP Address, only applicable if PipeOrSocket=1, otherwise ignored.

WebpServerIP = 127.0.0.1

;Web+ Server Port Number

WebpServerPort=6888

;Web+ Server Socket Password.

; For security reasons, WebpServerPassword in

; webplus.ini and webpsvr.ini must match for Web+

; Client and Web+ Server to cummunicate.

WebpServerPassword=webplus

;Automatically start Web+ Server NT service. 1=yes, 0=no

; Only applicable to the NT service version of Web+.

; If set to 1, Web+ will automatically start the

; "TalentSoft Web+ Server" NT service if it is not started.

AutoStartService = 1

 

[Messages]

;The following are messages for Web+ client to display as a result of bad communication between Web+ client and Web+ server.

;You may not use #variables# in the messages in this section. Web+ client does not recognize variable substitution (#variable#) in webplus.ini.

;Each error message is divided into 3 sections: c=Code, e=Explanation, t=Troubleshooting

00000header=<HR><H2> Error(s) Encountered While Processing Your Request </H2><TABLE BORDER><TR><TD>

00000c=<H3>Web+ Error Message:</H3><P>

00000e=<H3>Explanation:</H3><P>

00000t=<H3>Troubleshooting Information</H3><P>

00000footer=</TD></TR></Table><p> Please inform the site administrator that this error has occurred. Be sure to include the contents of this page in your message to the administrator. <HR>

;Web+ Client/Server Communication Failed

01000c=Web+ client/server communication failed.

01000e=The Web+ client (webplus.exe) cannot properly communicate with the Web+ server (webpsvc.exe or webpsvr.exe) due to one of the following reasons: <BR>(1) the Web+ server is not running, or <BR>(2) the Web+ client/server communication password, IP address, or port number do not match, or <BR>(3) the network connection between Web+ client and Web+ server is not working properly.

01000t=(1) Make sure that the settings for WebpServerIP, WebpServerPort, and WebpServerPassword in webplus.ini and webpsvr.ini match each other. <P>(2) Make sure that the Web+ server is properly installed and running. The Web+ server executable must be running before attempting to submit requests to Web+.<BR>Note: If the Windows NT service version of Web+ is being used, go to Control Panel | Services, and make sure that the "TalentSoft Web+ Server" service is started. If so, stop and re-start the service. If not, simply start the service.<BR>Note: If the Windows NT service version of Web+ is not being used, the Web+ server application can be made more reliable by having it start automatically in the Windows 'Startup' folder. <P>(3) Make sure that the network communication between Web+ client and Web+ server is working properly. Try to ping the IP address of Web+ client and Web+ server and make sure you are getting the correct response.

 

webpsvr.ini

Web+ server configuration file.

;*********************************************************

;* FILE NAME: webpsvr.ini : Web+ Server Initialization File

;* CORRESPONDING EXECUTABLE PROGRAM:

;* webpsvr.exe : Web+ Server executable version

;* or, webpsvc.exe : Web+ Server NT service version

;* DEFAULT PATH: Windows directory, eg: c:/windows, c:/winnt

;*

;* CREATED BY: TalentSoft Web+ Master

;* CREATED ON: 9/1/1995

;*

;* DESCRIPTION:

;* This initialization file contains important configuration

;* information about the Web+ Server, such as initialization

;* path names, ODBC data source names, server names, etc.

;* The ini files allows ease of maintanence and greater

;* portability. Configuration variables are not hard coded.

;*

;* There are two ways for you to change the settings in

;* the webpsrv.ini file: 1) by using the Web+ Administration

;* manager, 2) by manually changing the values in this ini

;* file. If you manually change the settings (option 2),

;* make sure that you restart the Web+ Server (or service)

;* for the changes to be read by Web+ Server.

;* Removing the comments in this file may improve Web+ speed.

;* Do NOT change this file unless you know what you are doing!

;*

;* NOTE:

;* An initialization file is composed of at least a

;* section name and a key name with the following

;* format:

;* [Section Name]

;* keyname=value

;* The quotes, double or single ("" or ''), around

;* the values are not required and do not affect results.

;*

;* COMMENT:

;* All comments should begin with a semicolon (;)

;* The variable names should not be case sensitive.

;*

;* MAINTENANCE LOG:

;* DATE ADDITION/MODIFICATION DESCRIPTION

;* -------- --------------------- ------------------

;* 09/01/95 ALL Web+ 1.0 release

;* 06/01/96 ALL Web+ 2.0 release

;* 10/01/96 ALL Web+ 2.1 release

;* 12/16/97 All Web+ 2.2 release

;* 02/16/97 All Web+ 3.0 release

;*******************************************************

;===================================

[Admin]

;Administration Section

;Admin Session Token (System use only. Do NOT modify manually!)

AdminST=10000.00000

;Admin Time Out , in minutes

AdminSessionTimeOut=20

;Admin Last Update Date-Time (System use only. Do NOT modify manually!)

AdminLastUpdate=1997-01-16 23:00:01

;Admin Password

AdminPassword=webplus

;Allow Remote Admin: 1=yes, 0=no

AllowRemoteAdmin=1

;Allow Remote Admin IP Address Range, example 198.36.217

;You may limit Web+ Remote Administration from a specific IP address or a group of IP addresses.

;For example:

;To limit Remote Admin to a specific IP, set AdminIP=your desired IP. eg: AdminIP=123.123.123.123

;To limit Remote Admin to a group of Class C IPs, set AdminIP=ClassC. eg: AdminIP=123.123.123

;To limit Remote Admin to a group of Class B IPs, set AdminIP=ClassB. eg: AdminIP=123.123

;To limit Remote Admin to a group of Class A IPs, set AdminIP=ClassA. eg: AdminIP=123

;To Allow all IP Addresses to Romote Admin, set AdminIP to Blank. eg: AdminIP=

AdminIP=

;Admin Email Address

AdminEmail=WebplusAdmin@EmailServer.YourCompanyDomain.com

;Admin Ini Password Required

;If AdminIniPasswordRequired is set to 0, then, it does not

;require password to process. If it sets to 1, then, password

;is strictly required in order to proceed.

AdminIniPasswordRequired=0

;Socket Time Out in seconds

;The default timeout for all socket operations in n seconds

SocketTimeOut = 100

SendHttpOk=0

 

;Web+ comment style option. 0=triple-dash, 1=double-dash, Default=0

;If set to 0, Web+ uses triple-dash style comment:

; <!--- Web+ code comment --->. This style is recommended.

;If set to 1, Web+ uses double-dash style comment:

; <!-- Web+ code comment -->. This is not recommended because it mixes Web+ comments with HTML comments and prevents regular HTML comments for being transferred to the browser, which may cause problems if the HTML contains JavaScript or VBScript.

CommentsUseTwoDashes=0

;===================================

[Main]

;Main Section

;Web+ Version (for reference only)

Version=3.0

;Encrypted LicenseID assigned by TalentSoft

LicenseID=

;Licensed User Name

LicUserName=Your Name

;Licensed Company Name

LicCompanyName=Your Company

;webplus.exe URL

WebpURL=/cgi-bin/webplus.exe

;Installation Reference Only. NOT USED!! Web Server HTML Root Path

WSHTMLRoot=

;Installation Reference Only. NOT USED!! Web Server CGI-BIN Path

WSCGIPath=

;Enable CrystalReport application: 1=yes; 0=no

EnableCrystalReports=0

;Web+ Server Port Number

WebpServerPort=6888

;Web+ Server Socket Password.

; For security reasons, WebpServerPassword in

; webplus.ini and webpsvr.ini must match for Web+

; Client and Web+ Server to cummunicate.

WebpServerPassword=webplus

;===================================

[Template]

;Template Section: Web+ Script Template (*.wml) file settings.

;Total Number of Templates (System use only)

LastTemplate=2

;Template File Extension, default value = wml (*.wml)

TmpExtension=wml

;Template 1 Logical Path

TmpLogicalPath1=/

;Template 1 Physical Path

TmpPhysicalPath1=c:\webplus\script

;Template 2 Logical Path

TmpLogicalPath2=/webplus

;Template 2 Physical Path

TmpPhysicalPath2=c:\webplus\script\webplus

;Total Number of Untrusted Scripts

NumUntrustedScripts=1

UntrustedScript1=/webplus/admin/admin.wml

;UntrustedScriptAllowOnly: Allow only the following operations to the script. Add the following values to determine your trust setting.

;1 = File Read

;2 = File Write

;4 = DB

;8 = webRun

;16 = webMail

UntrustedScriptAllowOnly1=15

;===================================

[Log]

;Log Section: Error and Performance Logging

;Directory of the error log file

LogFilePath=c:\webplus\log\

;Error logging level:

;0 No error logging: (Best performance)

;1 Information: logs all information messages, warning messages and errors. (Most detailed log, but worst performance. Not recommended for production web servers.)

;2 Warning: logs warning messages and errors

;3 Error: logs only errors (Minimal log. Good performance.)

LogLevel=3

;Append log file: 1=yes=webplus.log file is appended each time; 0=no=webplus.log is overwritten each time

LogAppend=0

;All echo info will only be sent to this IP address or class of IP addresses:

;You may limit Web+ echo only be viewable from a specific IP address or a group of IP addresses.

;For example:

;To limit Echo to a specific IP, set EchoIP=your desired IP. eg: AdminIP=123.123.123.123

;To limit Remote Admin to a group of Class C IPs, set AdminIP=ClassC. eg: AdminIP=123.123.123

EchoIP=

;Enables the display of Web+ syntax check on the browser:

; 1=yes; 0=no (If EchoCheckScript variable is not defined, Default=1, yes)

; eg: http://domain.com/cgi-bin/webplus.exe?checkscript=myscript.wml

EchoCheckScript=1

;Enables the display of Web+ syntax error script code on the browser:

; 1=yes; 0=no (If this variable is not defined, Default=1, yes)

EchoErrorMsgScriptCode=1

;Displays CGI Variables on the browser: 1=yes; 0=no

EchoCGI=0

;Displays CGI Form Variables on the browser: 1=yes; 0=no

EchoForm=0

;Displays SQL Staement on the browser: 1=yes; 0=no

EchoSQL=0

;Displays Overall Performance Time on the browser: 1=yes; 0=no

EchoTime=0

;Displays SQL Performance Time on the browser: 1=yes; 0=no

EchoTimeSQL=0

;Emails error messages to AdminEmail: 1=yes; 0=no

LogSendEmail=1

;===================================

[SMTP]

;SMTP Email Server Section

SMTP_Server=EmailServer.YourCompanyDomain.com

SMTP_Port=25

MailLogPath=c:\webplus\mail\log

MailSpoolPath=c:\webplus\mail\spool

MailErrorpath=c:\webplus\mail\error

NbrRetrial=2

;===================================

[WEBRUN]

;webRun Section: Running other executables

;Allow webRun execution: 1=yes; 0=no

WebRunEnabled=1

;webRun execution password

WebRunPassword=webrunpassword

;Allow webDLL execution: 1=yes; 0=no

WebDLLEnabled=1

;webDLL execution password

WebDLLPassword=webrunpassword

;===================================

[ODBC]

;ODBC Section: DataSource Access Permissions

LastODBC=1

;ODBC DataSource 1 Name

SQLDataSource1=Webplus_Examples

;Allow DataSource 1 SQL Select access: 1=yes; 0=no

SQL_Select1=1

;Allow DataSource 1 SQL Insert access: 1=yes; 0=no

SQL_Insert1=1

;Allow DataSource 1 SQL Update access: 1=yes; 0=no

SQL_Update1=1

;Allow DataSource 1 SQL Delete access: 1=yes; 0=no

SQL_Delete1=1

;Allow DataSource 1 SQL Stored Procedure access: 1=yes; 0=no

SQL_SP1=1

;ODBC Datasource login User ID

SQLUserID1=1

;ODBC Datasource login Password

SQLPassword1=1

;===================================

[FILE IO]

;File I/O Permission

LastFile=4

;Path1 is for Web+Admin webpsvr.ini read/write access

FileIOLogicalPath1=/bin

FileIOPhysicalPath1=c:\winnt\

;Allow file read access: 1=yes; 0=no

FileRead1=1

;Allow file write access: 1=yes; 0=no

FileWrite1=1

FileReadPassword1=webplus

FileWritePassword1=webplus

FileIOLogicalPath2=/

FileIOPhysicalPath2=c:\webplus\script\

FileRead2=1

FileWrite2=1

FileReadPassword2=webplus

FileWritePassword2=webplus

FileIOLogicalPath3=/temp

FileIOPhysicalPath3=c:\webplus\temp\

FileRead3=1

FileWrite3=1

FileReadPassword3=

FileWritePassword3=

FileIOLogicalPath4=/log

FileIOPhysicalPath4=c:\webplus\log\

FileRead4=1

FileWrite4=1

FileReadPassword4=

FileWritePassword4=

After modifying the Web+ configuration files, you must save your changes and restart the Web+ service (for NT service version) or restart the Web+ server application program (for NT or Win95 application version).

 

Appendix 4

Web+ Support Services

TalentSoft Web+ offers a variety of support options to help you get the most from Web+.

The quickest way to get answers to your questions is to browse through our Web+ Conference at http://www.TalentSoft.com , http://www.WebPlus.com. It contains a knowledge base containing answers to many common questions, descriptions of known problems, and information about new updates and features for Web+.

Send e-mail to our technical support at support@TalentSoft.com , support@WebPlus.com.

Call our support services between 9:00am - 5:00pm (Central Time), Monday through Friday, at (612)338-8883.

Technical Support

For Web+ technical support, contact:

Web+ Technical Support

E-mail: support@TalentSoft.com , support@WebPlus.com

Web: http://www.TalentSoft.com , http://www.WebPlus.com

NOTE: TalentSoft can not provide technical support for Web+ scripts which were not included with Web+ or which have been modified in any way not instructed in the official documentation. Please refer to our Web+ Conference for help with any problems.

Sales Information

For Web+ sales information, contact:

Web+ Sales Manager

TalentSoft / Talent Information Management, LLC.

Mail: PO Box 2997, Minneapolis, MN 55402, USA.

Tel: 612-338-8900 or 612-338-8883

Fax: 612-904-0010

E-mail: sales@TalentSoft.com , sales@WebPlus.com

Web: http://www.TalentSoft.com , http://www.WebPlus.com

Appendix 5

ANSI Character Set

0 ##

1 ##

2 ##

3 ##

4 ##

5 ##

6 ##

7 ##

8 *

9 *

10 *

11 ##

12 ##

13 *

14 ##

15 ##

16 ##

17 ##

18 ##

19 ##

20 ##

21 ##

22 ##

23 ##

24 ##

25 ##

26 ##

27 ##

28 ##

29 ##

30 ##

31 ##

32

33 !

34 "

35 #

36 $

37 %

38 &

39 '

40 (

41 )

42 *

43 +

44 ,

45 -

46 .

47 /

48 0

49 1

50 2

51 3

52 4

53 5

54 6

55 7

56 8

57 9

58 :

59 ;

60 <

61 =

62 >

63 ?

64 @

65 A

66 B

67 C

68 D

69 E

70 F

71 G

72 H

73 I

74 J

75 K

76 L

77 M

78 N

79 O

80 P

81 Q

82 R

83 S

84 T

85 U

86 V

87 W

88 X

89 Y

90 Z

91 [

92 \

93 ]

94 ^

95 _

96 `

97 a

98 b

99 c

100 d

101 e

102 f

103 g

104 h

105 I

106 j

107 k

108 l

109 m

110 n

111 o

112 p

113 q

114 r

115 s

116 t

117 u

118 v

119 w

120 x

121 y

122 z

123 {

124 |

125 }

126 ~

127 ##

128 ##

129 ##

130 ##

131 ##

132 ##

133 ##

134 ##

135 ##

136 ##

137 ##

138 ##

139 ##

140 ##

141 ##

142 ##

143 ##

144 ##

145 ‘

146 ’

147 "

148 "

149 •

150 –

151 —

152 ˜

153 ™

154 š

155 ›

156 œ

157 ##

158 ##

159 Ÿ

160  

161 ¡

162 ¢

163 £

164 ¤

165 ¥

166 ¦

167 §

168 ¨

169 ©

170 ª

171 «

172 ¬

173 ­

174 ®

175 ¯

176 °

177 ±

178 ²

179

180 ´

181 µ

182 ¶

183 ·

184 ¸

185 ¹

186 º

187 »

188 ¼

189 ½

190 ¾

191 ¿

192 +

193 Á

194 Â

195 +

196 -

197 Å

198 Æ

199 Ç

200 È

201 É

202 Ê

203 Ë

204 Ì

205 Í

206 Î

207 Ï

208 Ð

209 Ñ

210 Ò

211 Ó

212 Ô

213 Õ

214 Ö

215 ×

216 Ø

217 Ù

218 Ú

219 Û

220 Ü

221 Ý

222 Þ

223 ß

224 +

225 á

226 â

227 +

228 -

229 å

230 æ

231 ç

232 è

233 é

234 ê

235 ë

236 ì

237 í

238 î

239 ï

240 ð

241 ñ

242 ò

243 ó

244 ô

245 õ

246 ö

247 ÷

248 ø

249 ù

250 ú

251 û

252 ü

253 ý

254 þ

255 ÿ

** - ANSI value 8 is a Backspace, 9 is a Tab, 10 is a Linefeed, and 13 is a Carriage Return.

## - Represents a non-printable character.

 

Glossary

16-bit application A program written for a system (such as MS-DOS or Microsoft Windows version 3.1) that uses a 16-bit segmented architecture, in which each memory address points to a 16-bit word.

32-bit application A program written for a system (such as Microsoft Windows NT or Windows 95) that uses a 32-bit architecture, in which each memory address points to a 32-bit word.

8.3 filename convention The naming convention for filenames in MS-DOS that allows up to eight characters, with an optional period and three-character extension.

Argument keyword A dummy argument name. It can be used in a procedure reference before the equals sign [keyword = actual argument] provided the procedure has an explicit interface.

Array A set of scalar data, all with the same type and type parameters, arranged in a rectangular pattern. An individual array element is a scalar object. An array section, which is itself an array, is a subset of the entire array.

Browser A program that allows users to view pages on the world wide web.

Cache A special memory subsystem in which frequently used data values and instructions are duplicated for quick access.

CGI-BIN Most Web servers expect to find applications supporting CGI in a particular directory. This directory is often referred to as the CGI-BIN

CGI The Common Gateway Interface (CGI) is a standard for programs that allows the program to receive it input from a Web browser via a Web server, and to send its output back to that browser via the server.

Child Process See Process, Child.

Compilation The translation of source code into object code.

Compiler A program that translates source code, such as C++ or Pascal, into directly executable machine code.

Conditional Expression Or Boolean expression, logical expression. An expression that yields a Boolean value (true or false). Such expressions can involve comparisons, using relational operators such as the less-than (<) and greater-than (>) operators, and logical combination of Boolean expressions, using Boolean operators such as bitwise AND (&) and logical OR (||).

Connect String In ODBC, a string expression used to open an external database.

Constant An value that is not modifiable.

Dynamic-Link Library (DLL) A .DLL file that contains one or more functions compiled, linked, and stored separately from the processes that use them. The operating system maps the DLLs into the process's address space when the process is starting up or while it is running. The process then executes functions in the DLL. See also process.

Handle A variable that identifies an object; an indirect reference to an operating system resource.

HTML Hypertext Markup Language (HTML) is the language used to describe the content of Web pages.

ISAPI Internet Server Application Programming Interface (ISAPI) is a new specification for communications between Web servers and external programs. It provides better performance and uses fewer resources then CGI.

Key An entry (or node) in the registry. A key may have one or more values, subkeys, or both. With the exception of four predefined keys, all keys are subkeys of other keys. See also registry, subkey.

Named Pipe Named pipes operate between unrelated processes and across a networks

Operand An expression that precedes or succeeds an operator.

Operation A computation involving one or two operands.

Operator A lexical token that designates a computation involving one or two data values. Intrinsic operators are arithmetic (+, –, *, /, and **) or logical (.AND., .NOT., and so on). Executable programs can define operators that are not intrinsic.

Path A string that describes the location of a file or directory on a volume relative to the current directory or the root directory.

Pipe A communication conduit between two processes.

Port One of the input/output channels of a computer. A single computer can have many web servers running on it, each on a different port.

Process An executing application that contains one or more threads.

Primary Thread See Thread, Primary.

Process, Child A process initiated by another process (the parent). The child process can operate independently from the parent process. Additionally, the parent process can be suspended or terminated without affecting the child process.

Registry The database in which system configuration information is stored. This database takes the place of most configuration and initialization files for Windows and new Windows-based applications.

Script A file containing the Web+ and HTML instructions for creating a web page

Server A Web server is a computer that stores and provides hypertext and multimedia pages for users.

Session The time during which two computers (or a computer and a terminal) maintain a connection.

Statement A syntactically complete unit that expresses one kind of action, declaration, or definition.

String A data structure composed of a sequence of characters of identified with a symbolic name.

Structured Query Language (SQL) A database language used to query, update, and manage relational databases.

Syntax The grammar of a particular language, the rules governing the structure and content of the statements.

TCP Port The TCP port is the network "port" on which the server listens for incoming requests from clients.

Thread The basic entity to which the operating system allocates CPU time. A thread can execute any part of the corresponding application's code. A number of threads make up a Process.

Variable A data object whose value can be defined and redefined during execution of a program. A variable can be a named data object or an array element.

Win32 platform A platform that supports the Win32 API. These platforms include Intel Win32s, Windows NT, Windows 95, MIPS Windows NT, DEC Alpha Windows NT, and Power PC Windows NT.

 

Index