Docstoc

ONE - Download as DOC

Document Sample
ONE - Download as DOC Powered By Docstoc
					Table of Contents
TABLE OF CONTENTS .................................................................................................1
CHAPTER 1: WHAT IS WEB+......................................................................................6
   INTRODUCTION ...............................................................................................................6
   WEB+ .............................................................................................................................6
   APPLICATION PROGRAMMING INTERFACES (API‟S) .......................................................7
   THE WEB+ INTERFACE ...................................................................................................7
   WEB+ FEATURES ............................................................................................................8
      Database Integration.................................................................................................8
      File Manipulation......................................................................................................8
      Mail Integration ........................................................................................................9
      E-commerce Integration ............................................................................................9
      Custom Tags ..............................................................................................................9
   CONCLUSIONS............................................................................................................... 10
   FORMATTING CONVENTIONS IN THE USER‟S GUIDE ..................................................... 10
CHAPTER 2: HOW DOES WEB+ WORK ................................................................. 11
   ARCHITECTURE ............................................................................................................. 11
   WEB+ INTERFACE ......................................................................................................... 12
     1.   Web+ processes are persistent. ..................................................................... 12
     2. Web+ applications can run locally or remotely. ................................................. 13
   REMOTE WEB+ ............................................................................................................. 13
     Web+ with Firewalls ............................................................................................... 13
     Load Distribution .................................................................................................... 13
   SECURITY ISSUES WITH REMOTE WEB+ ....................................................................... 14
CHAPTER 3: INSTALLATION ................................................................................... 15
   INSTALLATION .............................................................................................................. 15
   DATABASE SUPPORT ..................................................................................................... 16
   OBTAINING A COPY OF WEB+....................................................................................... 16
   INSTALLING WEB+ ON UNIX ....................................................................................... 16
   INSTALLATION TROUBLESHOOTING FOR UNIX ............................................................ 18
      “Data Source Not Found” Error ............................................................................ 18
      “Web+ Client/Server Communication Failed” Error............................................. 19
   UNINSTALLING WEB+ ON UNIX .................................................................................. 19
   INSTALLING WEB+ ON WINDOWS ................................................................................. 19
   LICENSE AGREEMENT ................................................................................................... 20
   SERVER NAME .............................................................................................................. 20
   DATABASE ADMINISTRATION ....................................................................................... 21
   DESTINATION FOLDER .................................................................................................. 22
   WEB+ LICENSE INFO .................................................................................................... 22

Web+®User‟s Guide                                              1                                          Table of Contents
   SMTP MAIL SERVER .................................................................................................... 23
   ADMIN INFO WINDOW ................................................................................................... 23
   VIEW WEB+ STARTUP PAGE ......................................................................................... 24
   READY TO INSTALL WEB+ ............................................................................................ 24
   WEB+ INSTALLED SUCCESSFULLY ................................................................................ 25
   INSTALLATION TROUBLESHOOTING FOR WINDOWS ...................................................... 25
   CHANGES TO SETTINGS................................................................................................. 26
   UNINSTALLING WEB+ FOR WINDOWS .......................................................................... 26
CHAPTER 4: DATABASE PROCESSING ................................................................. 27
   WHAT IS ODBC (OR OPEN DATA BASE CONNECTIVITY)? ............................................ 27
   WHAT IS A NATIVE DRIVER? ........................................................................................ 27
   WHAT IS A DATA SOURCE? ........................................................................................... 27
   WHAT IS SQL? ............................................................................................................. 27
   SETTING UP ODBC DATA SOURCES ............................................................................. 27
CHAPTER 5: WEB+ ADMINISTRATION ................................................................. 28
   USING THE WEB+ SERVER MANAGER .......................................................................... 28
   PASSWORD.................................................................................................................... 28
   CONTENTS .................................................................................................................... 29
   MAIN ............................................................................................................................ 30
   ADMINISTRATION ......................................................................................................... 31
   LOGGING/DEBUG .......................................................................................................... 35
   FILE INPUT/OUTPUT...................................................................................................... 39
   DATASOURCES SCREEN (UNIX) ................................................................................... 40
   DATASOURCES SCREEN (WINDOWS) ............................................................................ 42
   ODBC DRIVER MANAGER (WINDOWS) ........................................................................ 44
   THE ODBC DATASOURCE ............................................................................................ 45
   MAIL CONFIGURATION ................................................................................................. 46
   WEBRUN SCREEN ......................................................................................................... 47
   CUSTOM TAGS .............................................................................................................. 48
   WEB+ MONITOR (WINDOWS) ....................................................................................... 50
CHAPTER 6: VIRTUAL HOSTING............................................................................ 51
   RESOURCES CONFIGURATION ....................................................................................... 51
   VIRTUAL HOST NAME .................................................................................................. 51
   SELECT WEBSITE FOR DEFAULT WEB SITE .................................................................. 52
   CONFIRMATION TO INSTALL ......................................................................................... 53
   INSTALLATION COMPLETED SUCCESSFULLY ................................................................ 53
CHAPTER 7: SCRIPTS – WML .................................................................................. 55
   CREATING THE SCRIPT .................................................................................................. 55
   SAVING THE SCRIPT ...................................................................................................... 55
   CHECKING THE SYNTAX (CHECKSCRIPT) ..................................................................... 56


Web+®User‟s Guide                                              2                                           Table of Contents
   EXECUTING THE SCRIPT ................................................................................................ 56
   WEB+ NAMING AND CODING CONVENTIONS ................................................................ 56
CHAPTER 8: WEB+ TAGS .......................................................................................... 58
   COMMAND TAGS .......................................................................................................... 58
   STATEMENT (CONTAINER) TAGS .................................................................................. 58
   VARIABLES ................................................................................................................... 58
   STRING LISTS ................................................................................................................ 59
   ARRAYS ........................................................................................................................ 59
   STRING LISTS VS. ARRAYS............................................................................................ 60
   PRINTING THE VALUE OF A VARIABLE .......................................................................... 60
   FUNCTIONS ................................................................................................................... 61
   COMMENTS ................................................................................................................... 61
CHAPTER 9: ADDITIONAL WEB+ FUNCTIONS ................................................... 63
   DATE AND TIME............................................................................................................ 63
   ENVIRONMENT VARIABLES .......................................................................................... 65
   WEB+ CONFIGURATION ................................................................................................ 67
     webIniGet Function ................................................................................................. 67
     webIniPut Function ................................................................................................. 67
     <WebIniRefresh> Tag ............................................................................................ 67
   WEB+ CACHE TECHNIQUE ............................................................................................ 68
   CLIENT STATE VARIABLES AND FUNCTIONS................................................................. 68
     Sockets ..................................................................................................................... 71
     Ports ........................................................................................................................ 71
     Opening a Socket..................................................................................................... 71
     Interacting With a Socket ........................................................................................ 72
     Closing a Socket ...................................................................................................... 72
   MISCELLANEOUS FUNCTIONS ....................................................................................... 73
     ArrayCount.............................................................................................................. 73
     FileTime .................................................................................................................. 74
     IsNumeric ................................................................................................................ 74
     ParameterExists ...................................................................................................... 75
     TreatedAsVar .......................................................................................................... 75
     UploadFile .............................................................................................................. 75
     ValidateCC .............................................................................................................. 76
CHAPTER 10: DATABASE INTEGRATION ............................................................ 78
   EXECUTING QUERIES WITH WEB+ ................................................................................ 78
   PRINTING QUERY RESULTS ........................................................................................... 78
   PRINTING A FORMATTED LIST OF QUERY RESULTS ...................................................... 80
CHAPTER 11: FILE MANIPULATION ..................................................................... 81
   MAINTAINING PATHS FOR FILE I/O ............................................................................... 81


Web+®User‟s Guide                                              3                                          Table of Contents
   DIRECTORIES ................................................................................................................ 82
      Current Directory .................................................................................................... 82
      Change Directory .................................................................................................... 82
      Make Directory ....................................................................................................... 82
      Remove Directory .................................................................................................... 82
   FILES ............................................................................................................................ 83
      Copy File ................................................................................................................. 83
      Rename / Move Files ............................................................................................... 84
      File Input/Output ..................................................................................................... 84
      Opening Files for Input and Output ........................................................................ 84
      Reading From a File ............................................................................................... 85
      Writing To a File ..................................................................................................... 86
      Closing files ............................................................................................................. 86
      .conf and .ini Files ................................................................................................... 86
      <WebGetProfile> ................................................................................................... 87
      <webPutProfile> .................................................................................................... 87
CHAPTER 12: WEB+ CUSTOM TAGS ..................................................................... 89
   WHAT ARE CUSTOM TAGS? .......................................................................................... 89
   COMMON USES OF CUSTOM TAGS ................................................................................ 89
CHAPTER 13: ENCRYPTION ..................................................................................... 91
CHAPTER 14: INTEGRATION ................................................................................... 92
   DYNAMIC LINKED LIBRARIES ....................................................................................... 93
CHAPTER 15: OTHER WEB+ 6.0 FEATURES ........................................................ 94
   <WEBTRY> <WEBCATCH> TAG .................................................................................. 94
   SUPPORT FOR XML ...................................................................................................... 94
   WEB+ WML DOM METHODS....................................................................................... 96
     <webXMLToQuery> Tag ........................................................................................ 96
   SIXTEEN ..................................................................................................................... 98
CHAPTER 16: INTERNATIONALIZATION ........................................................... 98
   WEB+ UTF-8 SUPPORT ................................................................................................. 98
     SQL Unicode Literal prefix ..................................................................................... 98
     UTF-8 aware Web+ stored procedure .................................................................... 99
     Unicode aware string functions ............................................................................ 100
     Web+ regular expression that are unicode aware are .......................................... 101
   CURRENCYFORMAT FUNCTION................................................................................... 102
   NUMBERFORMAT FUNCTION ...................................................................................... 103
APPENDIX A: WEB+ SUPPORT SERVICES.......................................................... 105
   TECHNICAL SUPPORT .................................................................................................. 105


Web+®User‟s Guide                                               4                                           Table of Contents
   SALES INFORMATION .................................................................................................. 105
APPENDIX B: TROUBLESHOOTING ..................................................................... 106




Web+®User‟s Guide                                         5                                      Table of Contents
                                                                                 ONE

Chapter 1: What is Web+

Thank you for choosing Webplus, Inc‟s Web+. This section will provide a clearer picture
of what Web+ is, how it works, and all of the things it can do.

Introduction
The business world‟s rapid increase in the use of the Web has created a tremendous need
for server applications that connect the Web to both applications and databases, and
deliver dynamic content. These web-based applications allow businesses to deliver
products, services, and messages dynamically and interactively. The advent of dynamic
content delivery using web pages has dramatically changed the face of web technology.
Originally, a dynamic web page that integrated user interaction with server-side programs
and databases required the use of a Common Gateway Interface (CGI) program.
Oftentimes, the CGI program was written from the ground up, which wasted time and
resources. The overhead for this type of application often limited the number of users
who could use the programs. Also, connecting the scripts to a database often proved to be
a nightmare. The Common Gateway Interface (CGI) proved not to be well suited for the
demands of today‟s business due to its overhead and inherent speed restrictions. A new
communication infrastructure was needed to connect Web servers with these new
applications. Webplus, Inc. responded to this need and developed a platform-
independent, web-enabled scripting language called Web+.

Web+
Webplus, Inc's Web+ is a powerful and comprehensive development language for use in
creating 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 that integrate with databases, file systems, e-mail, Java applets,
legacy applications, executable programs (EXEs), dynamic-link libraries (DLLs) and
shared objects (SOs) on many different operating systems. Web+ also communicates
with any TCP/ IP applications and simplifies database integration so that dynamic and
interactive web pages can be designed quickly and easily. Not only can Web+ integrate
databases with web pages, it can also manipulate information within the files as well as
the files themselves. Additionally, Web+ can upload files and information from the web,
schedule programs to run on the server, push dynamic content to a subscriber‟s web
page(s), deliver e-mail to customers, speak to other computers using XML, and develop
dynamic images for a web site. These are only a few examples of the power of Web+.


Web+®User‟s Guide                         6                    Chapter 1: What is Web+
Application Programming Interfaces (API’s)
In response to CGI performance problems, 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 as a server process and is persistent across
requests. Web server APIs also offer more functionality than CGI because you can write
extensions that perform access control, access the server‟s log file, and link in to other
stages in the server‟s request process. To take advantage of this, Web+ connects to all of
these API‟s.

The Web+ Interface
The Web+ interface combines the best aspects of the CGI and vendor APIs. Web+ offers
these distinct advantages:

 Performance                      Web+ processes are persistent, which means they can
                                  be reused to handle multiple requests. This solves the
                                  CGI performance problem of creating new processes
                                  for each request, and leads to faster, less memory
                                  intensive applications.
 Simplicity and Scalability       Web+ applications are written using the Web+
                                  development language, a scripting language based on
                                  the BASIC programming language and HTML.
                                  Anyone who knows BASIC and HTML can start
                                  building web-based applications almost immediately.
                                  Yet, Web+ can scale to meet the most demanding
                                  needs.
 Process Isolation, Fault        Because Web+ applications can run in separate,
 Tolerance and Process           isolated processes like CGI, process isolation and
 Security                        fault tolerance can be achieved at the optimum level.
                                 Web+ can be run on a separate server (which may
                                 even run on a different operating system) other than
                                 the one running the web server. Buggy Web+
                                 applications cannot crash or corrupt the core server
                                 (the web server) or other applications. Malicious
                                 Web+ applications cannot steal any secrets (such as
                                 session keys for encryption) from the Web server.
 Non-Proprietary Structure       Web+ runs on most popular operating systems (Linux,
                                 Solaris, FreeBSD, Windows 2000/XP/2003 etc), and
                                 supports most popular webservers (Netscape,


Web+®User‟s Guide                         7                     Chapter 1: What is Web+
                                  Microsoft IIS, Apache, etc.) and most ODBC
                                  compliant databases (MS Access, SQL Server, Oracle,
                                  MySQL, PostgreSQL, etc). Users of Web+ need not
                                  normally change their system in order to benefit from
                                  this extensibility.
 Architecture Independence The Web+ development language is not tied to a
                           particular server architecture. Virtually any Web server
                           can implement Web+. Applications can be single or
                           multi-threaded, regardless of the threading architecture
                           of the Web server.
 Support for Distributed          Web+ provides the ability to run applications
 Computing                        remotely. This is useful for distributing external Web
                                  sites, as well as integrating applications from different
                                  computers at geographically separate locations.



Web+ Features
The following list summarizes just some of the features of Web+:

Database Integration
    Web+ provides a gateway between the World Wide Web and SQL databases using
    the Open Database Connectivity (ODBC) interface to access a wide variety of
    relational databases using standard tools such as forms, scripts, external EXEs,
    DLLs, SOs and scheduling. Web+ can integrate with virtually any ODBC compliant
    database and make real-time queries to generate dynamic web pages based on the
    information in those databases. Any supported 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 web page
    results. Native drivers, which are used to increase connectivity speed between Web+
    and the database, are available for a number of different databases including Access,
    MySQL, and PostgreSQL. Third party drivers are available from their respective
    vendors.

File Manipulation
    Local files can be opened, read from, written to, copied, moved and deleted with
    Web+. Directories can be created, traversed and deleted. Even content within files,
    from a single character to the entire text, can be written to or read from a file. File
    manipulation allows Web+ to have complete control of the file system so as to
    provide a greater degree of flexibility in file manipulation.



Web+®User‟s Guide                          8                     Chapter 1: What is Web+
Mail Integration
   With the Web+ SMTP protocol, a Web+ script can automatically send e-mail to any
   address, or to a list of addresses internally or on the Internet. Combining SMTP and
   database functions of Web+, large customer lists and mass mailing systems can be
   quickly created and easily maintained. Mail can also be read from and managed by
   Web+, offering the ability to create customized e-mail programs specifically tailored
   to your business needs.

E-commerce Integration
    Secure e-commerce is easy to implement. Web+ offers integration with popular
 e-payment system gateways including CyberCash, IC VERIFY, payQuake, and more.

Custom Tags
   With Web+, it is possible for advanced developers to define their own custom tags.
   Using this feature Web+ has almost unlimited power. The Custom tags that have
   already been implemented include the ability to create custom images „on the fly‟ as
   well as creating dynamic graphical reports and calling of ColdFusion Custom Tags.

Faxing and Paging
   Web+ can also allow users to fax and page the system administrator when problems
   occur using the custom tag feature. Please note that the full implementation of this
   feature requires special network-enabled fax hardware.

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 virtually unlimited. Web+ can also communicate with other servers
   via sockets. POP-Mail clients, automated FTP and Telnet applications can be
   written in just a few lines of code.

Other Capabilities
   Web+ can, in real-time, manipulate variables and process information. To support
   this feature, 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 and/or footer, many web pages that
   include these scripts can be modified by editing a single file, thus significantly
   reducing development and production time.




Web+®User‟s Guide                         9                     Chapter 1: What is Web+
Conclusions
    Today‟s Web business applications need a platform that is fast, open, maintainable,
    stable, straight forward and secure. At Webplus. Inc, we have focused heavily on
    ensuring that the Web+ architecture meets these requirements and provides for a
    logical extension from proven but outdated deployed CGI technology. This ability
    allows developers to take advantage of the benefits of Web+ without losing their
    existing investment in CGI applications.

Formatting Conventions in the User’s Guide
The following conventions are used in the User‟s Guide:
   Convention                             Examples
   Web+ tags, statements and              webPrint
   functions are in bold type.            webSet
                                          CurrentTime ( )
                                          DateFormat (dateString, Method)
   Parameters and variables for tags,     The TimeOut parameter sets the..
   statements and functions are in        WeekDay (dateString)
   italic type.                           <WebCookie Name=CookieName
                                          Value=CookieValue>
   Code examples and screen outputs       <WebPrint>
   are boxed and in a distinctive font    The value of m is #n#. My name is #name#.
                                          The product of m and n is #m * n#.
                                          </WebPrint>
   The names of windows and screens       The “License Agreement” window will appear
   are in quotation marks                 The “Web+ Startup” screen will appear
   Buttons, selections and check          Click the [File I/O] button...
   boxes within the windows and           Click [Next] to continue…
   screens are in brackets.               Select [Yes] to require a password…
                                          Check the [Insert], [Update] and [Delete]
                                          options…
   Web site names, path names, com        http://www.webplus,
   file names, and extension names        /var/www/cgi-bin, Webplus.ini,
   are in the standard font. However,     webpmsg.conf, DLL, EXE
   these items are easily identified by
   their distinctive punctuation.




Web+®User‟s Guide                          10                   Chapter 1: What is Web+
                                                                                TWO

Chapter 2: How does Web+ Work
Web+ functions as a „middleware‟ product, layered between the client and server. Web+
controls and updates the content seen on the client‟s screen. For instance, as various
clients place orders for a vendor‟s products, Web+ updates the database queries „on the
fly.‟ Web+ then uses queries to update inventory levels and record sales, sending only the
most current data back to the client.

Architecture
The architecture of Web+ is as follows (see Figure 2.1). It starts with an end user or
“client” who uses his web browser to connect to a network. The connection session
begins and eventually comes to a web server. The web server is linked (via CGI, ISAPI,
NSAPI, etc.) to the Web+ client (which also can be running under any supported
operating system). The Web+ client is linked, via a TCP/IP socket, to the Web+ server
(running under any supported operating system), executing Web+ Markup Language
code. The Web+ server will link (if required) to an ODBC compliant database (once
again, under any operating system), local files, SMTP servers or any other machine via a
socket layer. The server processes the request and sends the results back to the Web+
client. The Web+ client returns the information back to the user via the web server and
ends at the client‟s web browser. The elegance and scalability of the architecture makes
Web+ a powerful development tool for easily and quickly creating dynamic, database-
driven web sites.




Web+ Interpreter and Web+ Markup Language (WML)


Web+®User‟s Guide                         11           Chapter 2: How does Web+ Work
When a Web+ application is executed (sent as a script file), Web+ reads, interprets and
executes the script code in real-time, then returns the output as an HTML or text file to
the client web browser. This scripting code is called the Web+ Markup Language
(WML), which is 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>) to prevent them from being confused with any standard or future
HTML tags. Variables and expressions in Web+ are typically surrounded by pound signs
(„#‟) (e.g., #UserName#, #a + 2#, #len(FullName)#). In its basic form, it is just this
simple!

Web+ Interface
Web+ interface functionality is similar to that provided by the CGI. To best understand
 the Web+ protocol, the basic CGI request processing proceeds as follows:
1.    For each request, the server creates a new process and the CGI process initializes
      itself.
2.    The Web server passes the information request (such as remote host, username,
      HTTP headers, etc.) to the CGI program as environment variables.
3.    The Web server sends any client input (such as user-entered field data 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 as a standard error response.
5.    When the CGI process exits, the request is complete and the process is terminated.

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

1.       Web+ processes are persistent.
     After finishing a request, Web+ processes wait (or listen) for a new request instead
     of exiting. Instead of using operating system environment variables and pipes, the
     Web+ client/server architecture permits Web+ programs to run on remote
     machines, using persistent 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 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 standard output and error information back to the
              server over the same connection.


Web+®User‟s Guide                         12           Chapter 2: How does Web+ Work
         5. When the Web+ process closes the connection, the request is complete.
            The Web+ process then waits for another connection from the Web server.
         6. Web+ also has the ability to support multithreading. Under this scenario, a
            given process takes multiple requests (or “Threads”), each given equal
            priority. This is a more efficient way to manage processes in a multiple-
            user environment.

2. 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. The
    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+
The ability of Web+ to run applications remotely (over a TCP connection)
provides major benefits! This is “Remote Web+”.

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 each 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 or
other security schema). The administrator may, alternatively, 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+, applications can run on the internal
network, simplifying the administrator‟s job. When used with appropriate firewall
configurations 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 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+, resource-intensive applications can be moved off (or remote
to) the Web server, giving the server administrator additional flexibility in configuring
the Web server. The administrator can configure Web+ applications “behind the scenes”
with out having to change any content links or the external view of the web site. The


Web+®User‟s Guide                         13           Chapter 2: How does Web+ Work
administrator can use several smaller, inexpensive server machines for applications and
can tune each machine to the application it is hosting.

Security Issues with Remote Web+
The two primary 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). Web+ also
supports the use of running remote connections over SSL.




Web+®User‟s Guide                        14          Chapter 2: How does Web+ Work
                                                                           THREE

Chapter 3: Installation
This section of the User‟s Guide covers the administrative aspects of Web+ and includes
everything from installing Web+ to configuring data sources. This section covers
chapters 3, 4, and 5, and will primarily be of interest to those who have system
administrator level access and the ability to configure applications.

Installation
 Platform     Hardware             Operating System         Web Server
 Linux         ntel Pentium®
                                    Turbo Workstation       Apache
                   /AMD K6®           6.0, Server 4.0 and    Netscape Enterprise
               32 MB RAM            later                     3.6 and later
               65 MB free hard     Red Hat 6.0 and         Netscape iPlanet 4.x
                                                                              TM


               drive space         later                     and later
                                    SuSE 6.0 and later
                                    Caldera Systems
                                    OpenLinux 2.3 and
                                     later
 Solaris       SPARC               Solaris 2.6, 2.7,
                                              TM
                                                             Apache
               X86 2.7, 2.8         2.8 and later           Netscape Enterprise
               32 MB RAM                                     3.6 and later
               65 MB free hard                              Netscape iPlanet 4.x
                                                                              TM


                  drive space                                and later
 FreeBS        Intel Pentium®      Free BSD 2.x,           Apache
                  /AMD K6®           3.x,4.x and later      NetscapeEnterprise 3.6
               32 MB RAM                                     and later
               65 MB free hard                              Netscape iPlanet 4.x
                                                                              TM


                  drive space                                and later

 Microsoft     Intel Pentium®      MicrosoftWindows        IIS 4.x, Personal Web
 Windows®        /AMD K6®            ®
                                       2000/XP/2003           Server, Peer Web
               32 MB RAM                                     Server 4.x and later
               65 MB free hard                              Apache
                drive space                                 Netscape Enterprise
                                                              3.6 and later
                                                             Netscape iPlanet 4.x
                                                                              TM


                                                              and later



Web+®User‟s Guide                        15                      Chapter 3: Installation
Linux, SolarisTM and Free BSD require a TCP/IP connection. Windows requires a TCP/IP
network connection and a Windows compatible server. Visit Webplus, Inc.'s website for
the latest revision to our system requirements at www.webplus.com.

Database Support
 Platform       Supported Databases                    Browsers
 Unix/Linux       T.c.x MySQL 3.22.xx (Native          Microsoft Internet Explorer
                    Driver)                              4.x and later
                  Global Development Group             Netscape Navigator/
                  PostgreSQL 6.5.x (Native              Communicator 4.x and later
                    Driver)
                  Oracle® 8.1.5 or higher (Native
                    Driver)
                  Any other ODBC compliant
                    database
                  Microsoft Access 97/2000
                    (ODBC)
                                                        Microsoft Internet Explorer
                  Microsoft SQL ServerTM 6.5,
                                                         4.x
 Windows            7.0 (ODBC)
                                                        Netscape Navigator/
                  Oracle® 8i (ODBC)
                                                         Communicator 4.x
                  Any other ODBC compliant
                    database

Obtaining a Copy of Web+
A Web+ bannerware version of Web+ for either UNIX or Windows can be obtained by
going to the download area of our web site at http://www.webplus.com. You may also
purchase a full-featured version of Web+ at the same web address, or by contacting
Webplus,Inc.



Installing Web+ on UNIX
Web+ can run on most UNIX platforms (Sun Solaris, Free BSD, etc.) and most Linux
distributions (RedHat, SuSE, TurboLinux, Caldera, etc.). A Web server must be installed
before you can successfully install Web+. There are several Web server software
distributions that run on UNIX platforms. The most frequently deployed software
includes Apache and Netscape. Since Web+ client software is like a CGI program, it will
be installed in the cgibin directory of web server. This is why the Web server must be
installed BEFORE Web+. The web server type and the cgi-bin directory of your web
server will be needed during installation. Keep this information handy.



Web+®User‟s Guide                        16                      Chapter 3: Installation
Web+ provides native API connectivity with three popular databases for Unix: MySQL,
PostgreSQL and Oracle. (Web+ connects to most databases through ODBC.) If you want
to use other databases, you will need to install the corresponding ODBC drivers BEFORE
installing Web+.

To install Web+ onto a UNIX system, follow these six easy steps:

    1.   Download the Web+ compressed (*.tar.gz) file. A License ID will be included
         if you purchased a copy of Web+. The license ID will be needed during
         installation. Keep it handy. If you are installing a demo version of Web+, use the
         default License ID: “bannerware”.
    2.    Login as “root”. You must log in as “root” to install Web+, otherwise the
         installation will fail.
    3.    Run the installation script. Enter the directory of the uncompressed Web+ file
         and type:

              sh install.sh or ./install.sh
    4.   Complete the Web+ configuration. The computer will prompt you to enter the
         configuration information. Read over your selections carefully! Once you have
         verified the information is correct, the install script will install Web+. This
         includes moving all files to their proper locations and creating the necessary
         symbolic links. Changes can be made to these settings by using the Web+ Server
         Manager via a web browser. See Chapter 5: “Web+ Administration” for more
         information.
    5.   Verifying the installation. Before you run any example applications, verify that
         Web+ is running correctly by accessing the following URL on your browser:
             http://localhost/cgi-bin/webplus.cgi?about

    If the installation was performed properly, the Web+ “About” screen (Figure 3.1)
    will appear on your web browser. You can now access the Web+ “GETTING
    STARTED” page at
               http://localhost/webplus/index.htm
    to begin administering your Web+ server. Web+ provides native API connectivity
    with three popular databases for Unix: MySQL, PostgreSQL and Oracle. (Web+
    connects to most databases through ODBC.) If you want to use other databases, you
    will need to install the corresponding ODBC drivers BEFORE installing Web+.




Web+®User‟s Guide                             17                    Chapter 3: Installation
Figure 3.1 – The Web+ Getting Started screen.

Verifying the installation is important because it determines whether the databases have
been connected properly . Click the [Verify Web+] selection on this screen to continue.
The “INSTALL VERIFICATION” screen will appear in your web browser (Figure 3.2).
Run the two diagnostic tests: “About Web+® Page” and “Web+ User Authentication”. If
these two diagnostic tests run successfully, then Web+ was properly installed.




Figure 3.2 – The INSTALL VERIFICATION screen.

Installation Troubleshooting for UNIX
Select the “Example Programs” link from the Navigation Menu. If the example
applications fail to run properly, there may be problems with the settings. Two of the
most common errors and the remedies are listed on the next page:

“Data Source Not Found” Error
Web+ is unable to find the requested data source. Check the following remedies to
correct this problem:


Web+®User‟s Guide                         18                     Chapter 3: Installation
      1.   Make certain that the database name is listed in the Datasources section of the
           Web+ Server Manager.
      2.   Make certain that the daemon responsible for running the database is active.
           (You can use the “ps” command to view the process table (use the “ps ax”
           command for Linux. Use the “ps-ef” command for Solaris or FreeBSD.) Pipe
           the output of the comps to a command such as “grep” and search for your
           database to verify that the database is running.)
      3.    If the database daemon is running, verify that the port information is correct.
           Note that the rpm installations of MySQL use “/var/lib/mysql/mysql.sock” as
           the port number rather than a TCP/IP numeric value. For binary and source
           installations, the port number is “3306” for MySQL.

“Web+ Client/Server Communication Failed” Error
Web+ client and server are unable to communicate with each other.
       1. Verify that the Web+ server is running. To restart Web+, enter
           “/webplus/webpadmin restart”. You should see the message “Web+ Server
           (webpsvr) started.”
       2. If the service starts and you are still having problems, verify that the directory
           /usr/local/webplus and all of its subdirectories have permissions of “rwxr-xr-
           x” (or 755 in octal code). Also verify that the cgi-bin directory used by your
           web server has the same permission structure.
       3. Next, make certain that your web server is set to execute CGI scripts outside
           the cgi-bin script alias path if webplus.exe or webplus.cgi was installed in a
           directory other than the central cgi-bin directory.
Always make sure to refresh the web browser screen after making any changes. You may
also need to clear the browser‟s cache. Since the procedure varies from browser to
browser, refer to your web browser‟s documentation for information on how to perform
these two functions. Finally, if you make any changes to the configuration (.conf) files,
you must restart the Web+ service for the changes to take effect.

Uninstalling Web+ on UNIX
Run the script: /webplus/UNINSTALL. The script will delete all Web+ directories and
files from your system. CAUTION! If there are scripts you wish to keep, make certain
that you save them to a location outside of the Web+ directory structure before
uninstalling Web+.

Installing Web+ on Windows
When you purchase Web+, you will receive a self-extracting executable file and a
License ID (the bannerware version will not include a License ID). You will need these
to install Web+. You must first login as the system administrator. Otherwise, the
installation will fail. Run the executable file to begin installation. The “Welcome to
Web+6.0 Installation wizard” window appears (Figure 3.3). Click [Next] to continue.


Web+®User‟s Guide                          19                       Chapter 3: Installation
Figure 3.3 – The Welcome to Web+ setup window

License Agreement
The “License Agreement” window appears next (Figure 3.4). Read the License
Agreement carefully. If you would accept the agreement select the first radio button and
click [Next] to continue, [Back] to go back to the previous screen.




Figure 3.4 – The License Agreement window.

Server Name
Enter the server name (fully-qualified domain name) in the textbox as shown (Figure
3.5). Enter the server name in the textbox and click [Next] to continue.




Web+®User‟s Guide                         20                     Chapter 3: Installation
Figure 3.5 – Server Name Window

Database Administration
The “Database Type” window appears next to select the type of database system that
would be used for the Web+ applications that would run in that machine. Select one
from the list as shown (Figure 3.6) and click [Next] to continue.




Figure 3.6 – Database Type




Web+®User‟s Guide                        21                      Chapter 3: Installation
Destination Folder
The “Destination Folder” window will appear next (Figure 3.7). By default, Web+ will
install into the directory C:\webplus. Click [Browse] if you would like to install the
software into another directory. Click [Next] to continue.




Figure 3.7 – The Destination Folder window.

Web+ License Info
Downloadable version of Web+ should have „Bannerware‟ as the Web+ LicenseID and
other purchased copy of Web+ should have the licenseID provided to you by WebPlus,
Inc. Fill in the details as shown (Figure 3.8) and click [Next] to continue.




Figure 3.8 – The Web+ license Info window




Web+®User‟s Guide                        22                     Chapter 3: Installation
SMTP Mail Server
The “SMTP Mail Server” window appears next (Figure 3.9). This window asks for the
SMTP Server Name, which is the name of your mail server; and the SMTP Server Port
Number, which is the port that the mail server uses. (This number is usually 25.)




Figure 3.9 – The SMTP Mail Server Folder window.

Admin Info window
Page to enter details for administration of Web+6.0 is follows. Figure 3.10 shows the
window where the admin password and E-mail address is given. The Web+ Admin
Password is the administration password used to access the Web+ Server Manager
application. Make sure you keep it in a safe place. Click [Next] to continue.




Figure 3.10 – The Admin Info window.




Web+®User‟s Guide                         23                       Chapter 3: Installation
View Web+ Startup Page
To view the Web+ startup page to test the installation, check “Open Web+ Startup Page”.
The startup page will open after the installation is complete. Click [Next] to continue.




Figure 3.11– View Web+ Startup Page

Ready to Install Web+
If you decide not to install Web+ at this time, this is your last chance to cancel. You may
also go back to correct any of the configurations previously entered. When you are ready
to commit the installation, click [Next] to continue.




Figure 3.12 – Ready to Install Web+ window




Web+®User‟s Guide                          24                       Chapter 3: Installation
Web+ installed Successfully
If the installation of Web+6.0 is completed successfully, a window appears as shown
(Figure 3.13)




Figure 3.13 – Ready to Install Web+ window

Installation Troubleshooting for Windows
The following is a list of possible remedies for common installation problems. (These can
be viewed on the web browser by scrolling down on the “Web+ Verification” page.)
    1.      If you run a Web+ script (*.wml) and receive a “Communication Error,”
            check whether the “Web+ Server” service is running. To do this, go to
            Control Panel > Administrative Tools > Services. Also, make sure the
            password settings in webplus.ini and webpsvr.ini (found in C:\Windows or
            C:\Winnt) are the same.
    2.      Check the URL to make sure that your browser is not using a local file
            (file://). Web+requires applications to be using an HTTP connection
            (http://).
    3.      Make sure the /cgi-bin alias is mapped to the right location for your web
            server.
    4.      If you receive a download screen for downloading webplus.exe or a
            vnd/wap file, then your web server configuration is incorrect. There are two
            common reasons for this. Assuming the web server is Internet Information
            Services (IIS), one common problem is not having “Scripts and
            Executables” permission on the website (in the Home Directory tab of the
            website properties). The other reason is not having the Web+ Web Service
            set to “Allowed” in Web Services (Windows Server 2003 only).
    5.      If everything is correct, you should see an “About” page when you type the
            following URL: http://webplus/index.htm and click the “About” link.


Web+®User‟s Guide                         25                      Chapter 3: Installation
    6.        Next, access the example programs on the same web page. The example
             applications should run correctly.
    7.       If you receive an error message “ODBC data source not found”, this
             means that the ODBC data source has not been set up correctly. Access the
             “Datasources” page in the Server Manager to set up the ODBC datasources.
    8.        If a “400 Bad Request” error appears when running a Web+ script, then
             you are probably attempting to execute a script using “localhost” as the host
             name, but the machine is multi-homed (with multiple IP addresses/web
             sites). If this occurs, you must change “localhost” to a valid host name
             configured on that server.
    9.       Click the [Refresh] button on the web browser for each test in order
              to retry the test.

Changes to Settings
Changes can be made to settings by using the Web+ Server Manager via a web
browser. See Chapter 5 Web+ Administration for more information on this.

Uninstalling Web+ for Windows
To uninstall Web+ for Windows, use Control Panel > Add/Remove Programs. Simply
follow the on-screen instructions. It is recommended that you backup any Web+ scripts
you may wish to keep prior to uninstalling Web+.




Web+®User‟s Guide                         26                       Chapter 3: Installation
                                                                                 FOUR

Chapter 4: Database Processing
One of the most powerful features of Web+ is its ability to communicate with ODBC
databases via a datasource.

What is ODBC (or Open Data Base Connectivity)?
ODBC is the standard method for programs and databases to communicate. 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 ODBC API functions. When these functions are
called, the driver manager calls upon a database-specific driver DLL to execute database
operations. A single-tier DLL driver manipulates the files directly. A multiple-tier DLL
driver calls a database engine to manipulate the files.

What is a Native Driver?
A native driver is used to connect to a specific database. Using a native driver is faster
than using ODBC. Native drivers are only available for UNIX/Linux. Web+ currently
supports native drivers for MySQL, PostgreSQL and Oracle.

What is a Data Source?
ODBC applications usually connect to databases by using ODBC datasources. An ODBC
data source is a logical name, or handle, for the associated database or the ODBC driver.
Web+ uses ODBC datasources to connect to the corresponding databases through the
appropriate ODBC drivers.

What is SQL?
SQL (Structured Query Language) is the standard language that is used to communicate
with databases. Compared to the C language, SQL is non-procedural and uses syntax
consisting of a few intuitive words that tells the database what kind of query to make. For
example, SELECT Name, Phone FROM Users would select all of data in the Name and
Phone fields from the Users table of a database.

Setting up ODBC Data Sources
See the section on Data Sources in the next chapter (Chapter 5 Web+ Administration) for
a detailed description on how to set up and configure an ODBC-compliant database.




Web+®User‟s Guide                          27             Chapter 4: Database Processing
                                                                                  FIVE

Chapter 5: Web+ Administration
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
datasources, File I/O securities and SMTP e-mail connection. Web+ makes changing
options very simple with the Web+ Server Manager, which is accessed via a standard
web browser.

Using the Web+ Server Manager
The Web+ Server Manager is a set of scripts written in Web+ that are designed to
simplify the management of Web+. The Server Manager can be accessed both locally and
from a remote web browser. Server Manager for Unix and Windows may be accessed,
via the Web+ “GETTING STARTED” page and selecting the “Web+ Server Manager”
link. The “GETTING STARTED” page is accessed through the following URL:
             http://YourHostName/webplus/index.htm
The functions for the UNIX Server Manager and the Windows Server Manger are nearly
identical. The descriptions that follow apply to both the UNIX and the Windows
versions. Differences in the UNIX and Windows versions will be spelled out in the
individual sections that follow.

Password
The “Password” screen will appear first (Figure 5.1). Enter the Web+ Administrator
Password (defined during installation) and click [Login] .If no action is taken within a
few minutes while you are in the Server Manager, you will be timed-out by the Web+
software. The “Password” screen will re-appear and you will be asked to re-enter your
password.




Figure 5.1 – The Password screen.




Web+®User‟s Guide                          28            Chapter 5: Web+ Administration
Contents
After a correct password is entered, the MAIN screen of the Web+ Server Manager will
appear (Figure 5.2). This window includes a list of links to the different functions of the
Server Manager. The sections are: [MAIN],[Administration], [Scripts], [Logging/Debug],
[File I/O], [Datasources], [MailConfiguration], [WebRun], [Custom Tags] and [Web+
Startup Page]. (Note: The figure below shows the UNIX version of Web+, which has
nine links. The Windows version of Web+ has an extra link titled [Monitor].) Click a link
to enter that section and the screen will display the functions and the current settings for
that section. Click the [HELP] link for information about each function on the current
screen. To change the settings, simply type in the new information into the appropriate
text box(es) and then click the [Apply] button.




Figure 5.2 – The Main screen of the Web+ Server Manager.

There are 4 buttons at the bottom of this screen: [Apply], [Reset] ,[Logout] and [Restart
the Web+ Server]. Click the [Apply] button to save the changes made to the page. Click
the [Reset] button to erase any changes and restore the settings back to the point at which
the [Apply] button was last clicked. Click the [Logout] button to end the Server Manager
session. Click the Restart Web+ Server to restart the Web+ server. If logging is enabled,
additional information is available on each screen by using the scroll bars. Scroll down to
view this information, which includes Execution Time, SQL Execution Time,
Parameters, CGI, URL, Form, Cookie, Client State and Shared Variables.

 One example of logging information follows:
 A partial list of this additional information is as follows:
 Execution Time:
 1262 milliseconds
 SQL Execution Time:


Web+®User‟s Guide                            29             Chapter 5: Web+ Administration
 0 milliseconds
 Parameters
 The CGI Variables:
 SERVER_SOFTWARE=Netscape-Enterprise/3.5.1
 SERVER_NAME=foo.bar.com
 GATEWAY_INTERFACE=CGI/1.1
 SERVER_PROTOCOL=HTTP/1.1
 SERVER_PORT=80
 REQUEST_METHOD=POST
 HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/
 vnd.ms-powerpoint,

Main
The “Main” screen appears first (Figure 5.2) and contains the parameters related to the
licensing and operation of Web+. The settings for the Main section are listed below:

 Parameter                    Function
 Licensed Username and        Name of the person and company to which the Web+
 Licensed Company             license belongs to. The entries can be changed at any
 Name                         time.
 Web+ URL path                The URL path of the executable Web+ client , relative
                              to the HTML root directory. If you wish to move the
                              Web+ engine to a newer location, make sure that the
                              entry reflects the new location
 Web+ ServerLicense ID        The encrypted license ID required to run Web+ . Do
                              not change this value unless instructed to by Webplus.
                              Inc, If not correct, Web+ would not run and would
                              have to be fixed manually (by modifying in the
                              webpsvr.conf file for UNIX and webpsvr.ini file for
                              Windows.)
 WebServerHTMLroot            Enter the absolute path to the Webserver‟s
                              rootdirectory.       Common         paths  include
                              :/user/local/apache/htdocs/home/httpd/html     OR
                              /usr/netscape/server4/docs/        (UNIX)      OR
                              C:\inetpub\wwwroot\html (windows).
 WebServer Script Path        The path leading to your web server‟s script directory.
 (CGI)                        Common paths include:
                               /user/local/apache/cgi-bin, /home
                              httpd/cgi-bin/usr.netscape/server4/cgi-bin



Web+®User‟s Guide                          30           Chapter 5: Web+ Administration
 Run As User                   (Applies only to the UNIX platform.) The user that the
                              Web+ server processes run under. It is suggested that
                              they run under user “nobody”, the standard for web-
                              based processes. If you are unsure what this process
                              should be run as, use the owner of your HTTP
                              processes, or contact your System Administrator
 Web+ Server Password         You can change the password in the Administration
                              section of the Server Manager. (See the next section).
 Web+ Server Port,            Port address for the Web+ server and the Web+
 Web+ Monitor Port            Monitor.

 Restart the Web+ server      This button allows administrators to Remotely Restart
                              the Web+ Server (Windows NT version only.)


Administration




Figure 5.3 – Administration Screen

Click the [Administration] link to display the “Administration” screen (Figure 5.3). The
administration section contains all parameters related to the overall administration of
Web+. The settings for the administration section are listed below.




Web+®User‟s Guide                         31            Chapter 5: Web+ Administration
 Parameter                Function
 Require Administration   Select [Yes] to impose that the Admin password is
 Password                 required to log into the Server Manager. Select
                          [No] to allow access without a password.

 Administration           The password used to access the server manager.
 Password                 Also the password required for many Web+
                          commands including webMonitor, webiniGet,
                          webiniPut and webiniReferesh functions.
 Administrator e-mail     The email address of the Web+ administrator.
 address                  Any automatic email sent by the Web+ server
                          manager is sent to this email address.
 Remote Administration    A security precaution to limit access to the server
 IP                       manager. Only those systems at this IP (or
                          multiple IPs, eg. 222.222.222.1 |222.222.222.2)
                          (or class of IPs eg. 222.222.222 for the entire class
                          C IP) may execute the Server Manager. Leave this
                          field blank if the Server Manager needs to be
                          accessible from any IP.
 Administrator Time out   The number of minutes the server manager may
                          sit idle before requiring the user to re-login.

Use Domain Socket         (Applies only to UNIX platforms.) This enables
                          an interprocess communication mechanism that is
                          much more efficient than TCP/IP. It requires that
                          the Web+ client and the Web+ server are on the
                          same file system and the same machine.
 Socket Time Out          The number of seconds Web+ will wait for a
                          confirmed socket connection before stopping
                          because the socket cannot be created.
 Thread Time Out          The number of seconds Web+ will wait for a
                          thread to finish task before halting it and returning
                          an error.
 Script Cache Size        The amount of RAM that will be used for caching
                          Web+ scripts on the server. Web+ will execute
                          frequently used scripts faster when a larger cache
                          size is used because the frequently used scripts
                          will be stored in and accessed from memory.
 Number of recursive      Controls the number of recursive webIncludes.
 webIncludes allowed      Enter “-1” to disable checking of recursive
                          webIncludes. Enter “0” to not allow recursive

Web+®User‟s Guide                     32            Chapter 5: Web+ Administration
                         webIncludes. Enter a positive number to allow
                         that many levels of recursion.
 Server Push Password    The password that is supplied to the WebContent
                          tag when the WebPushPage tag is used. This
                          command is password protected because of the
                          potential for using it incorrectly, which may
                          cause Web+ to implement the command
                          continuously.
 Enable Relative Path    Specifies the default behavior of scripts without a
                         leading forward slash “/”. When enabled, Web+
                         will treat a path without the leading forward slash
                         “/” as relative to the current script path. When
                         disabled, a path without a leading forward slash
                         “/” will be treated as absolute from the root.
 Comment Style           Specifies the comment style. Web+ can use either
                         triple dash (“<!--- ... --->”) or double dash (“<!--
                         ... -->”) to denote Web+ comments. These
                         comments will not be available in the source code
                         of the web page. Triple dash is preferred, but
                         double dash is provided for backwards
                         compatibility.
 Load saved shared       Preserves shared variables. Normally, shared
 Variables               variables are lost if the Web+ server is stopped.
                         Check this option to allow the Web+ server to
                         save the shared variables before stops and to load
                         them upon restarting.
 Send HTTP OK            Returns the command sequence “HTTP/1.0 200
                         OK” to the web server when enabled. While
                         generally not needed, returning this command
                         sequence ensures that all browsers will understand
                         that the requested page has been found.
 Counter GIF File        Path where the counter application‟s GIF file is
 Location                located.
 Enable About Page       Setting the flag to Yes enables the „About Page‟
                         and setting it to No disables the display of the
                         about page.
 Enable Error Trapping   Administrator can either allow or disable the error
                         trapping capabilities of Web+ by setting this flag
                         to Yes or No respectively.




Web+®User‟s Guide                   33             Chapter 5: Web+ Administration
Scripts




Figure 5.4 – Scripts Screen

Click the [Scripts] link to display the Scripts screen (Figure 5.4). The Scripts section
contains the parameters to add and delete script mappings. Script mapping is used to
define how a logical path is mapped to a physical path. For the sake of security, Web+
script files need to be accessed by using logical paths. There can be any number of script
directories for Web+. Also, each Logical script directory must have a corresponding
Physical directory. The settings for the Scripts section are listed below:
 Parameter                          Function
 Script File Extension              The default extension for Web+ script files on your
                                    computer. If no script extension is specified in the
                                    script parameter of the URL, the extension supplied
                                    in the text box will be used. Additional extensions
                                    can be supplied by separating them with a vertical
                                    bar “|” (example: wml|whtml). The extension .wml
                                    is recommended within the default extensions for
                                    compatibility.
 Script Cache Size                  The amount of system RAM that will be used for
                                    caching Web+ scripts on the server. Web+ will
                                    execute frequently used scripts faster when a larger
                                    cache size is used because the scripts will be stored
                                    in and recalled from memory.
 Logical/Physical Paths             To add a new directory, enter the Logical and
                                    Physical Paths in the blank input fields at the
                                    bottom of the list, and then click [Apply].


Web+®User‟s Guide                         34            Chapter 5: Web+ Administration
                                  To delete a directory, remove the Logical Path
                                  name, and then click [Apply].
                                  To change an existing directory, make the
                                  necessary changes you want in the supplied input
                                  fields, and then click [Apply].
 Virtual Host Name                The virtual host name that will use this logical path.
                                  If all host names are to use this path, or if virtual
                                  hosting is not used on this server, it should be left
                                  blank. Multiple host names may be listed, separated
                                  by a vertical bar “|” and wildcards may be used (*
                                  and ?).
                                  For example, *.webplus.com will match both
                                  www.webplus.com, and developers.webplus.com.
                                  www?.webplus.com will match
                                  www1.webplus.com and www2.webplus.com.


Logging/Debug




Figure 5.5 –The Logging/ Debug Screen

Click the [Logging/Debug] link to display the Logging/Debug screen (Figure 5.5 ). This
section allows you to configure the level of error logging Web+ does and what sort of
debugging information is provided to the programmer within the scripts themselves. The
settings for the Logging/Debug section are listed below.

Web+®User‟s Guide                       35            Chapter 5: Web+ Administration
Parameter                 Function
Log File Path             The directory into which Web+ will write the log file.
                          This is an absolute path
                          (Example : /usr/local/webplus/log)
Log Level                 The degree to which Web+ logs error, warnings, and
                          informational messages.
                          0- No error logging.           Provides     the   fastest
                             performance.
                          1- Errors only
                          2- Warnings and informational messages
                           3- Errors, warnings, and informational messages.
                          Slowest performance.
Log File                  The command to either append or overwrite the logfile
                          upon start up. When Web+ starts it will either append
                          to the current log file or overwrite it.
Email Errors to Admin     The command to send e-mail errors to the
                          administrator. If this is set to “Yes”, then all errors
                          generated by Web+ will be sent, via e-mail, to the
                          Admin e-mail account. (The Admin e-mail account is
                          set in the Admin section).
Echo System information   The command to allow system-debugging information
                          to be made available on the scripts. This information
                          is useful for debugging new scripts and can be limited
                          in scope so that it is only visible to specific people.
Echo IP                   Controls the echo variables. If this text box is blank,
                          then all users who execute scripts will see echoed
                          variables. This can be set to an IP (or multiple IPs,
                          e.g.: 22.222.222.1|222.222.222.2)
                          (or class of IPs, e.g.: 222.222.222. for the entire class
                          C IP) to restrict where echoed variables are displayed.
                          Only those sites at the specified IP(s) will be able to
                          view echoed variables. It is suggested to only include
                          IP addresses of your development machines.
Echo Performance          Total Time is the duration from when Web+ was
                          called to when the last of the document was sent.
                          Database Access Time is the time spent making
                          database queries. Checking these boxes will allow
                          viewers to see how long the script or database took to


Web+®User‟s Guide                 36            Chapter 5: Web+ Administration
                               run(in milliseconds).
Echo Variables For SQL,        Checking these boxes allows specific information to
CGI, URL, Form and             be shown at the bottom of scripts being run through
                               Web+. SQL variables are variables related to SQL
cookie Client-State, Shared    database query statements. CGI variables are server
                               side variables. These variables include the browser
                               being used, the host name and other information
                               specific to each browser. URL, Form and Cookie
                               variables are variables submitted via links, forms, or
                               set by cookies. Client variables are set via the Client
                               State variable commands within the Web+ scripts
                               themselves. They contain information about the user
                               based on the user‟s session. Shared variables are
                               shared by all scripts on the Web+ server.
Debugging: Check script        For more detailed debugging information, the URL
syntax, Error code             “http://hostname/cgi-bin/webplus.exe?script=…” can
                               be       replaced    with      “http://hostname/cgibin/
                               webplus.exe?checkscript=...” Check this box to
                               activate this feature. If the box is not checked, no
                               source code or error messages will be available when
                               checkscript is run. Check this box to display the
                               source code near any error in an executed Web+
                               script. If the box is not checked, the source code
                               around the error line will not be displayed. This
                               information will only show up on the IP addresses
                               listed in EchoIP.
Redirect URL for "Script Not   Content of the redirected URL is displayed when
Found" Error                   Script Not Found error occurs. Logging/Debug screen
                               has an additional feature called [View Log]. Click
                               [View Log] to display changes to the Web+ log. A
                               portion of a sample Web+Log is shown.




Web+®User‟s Guide                     37               Chapter 5: Web+ Administration
 Web+ Log
 webplus.log
 Web+ Server Initialization Started: 100-05-18 15:53:28
 PRODUCT INFORMATION:
 Version: 4.6 Client-Server (webpsvr)
 Compile Number: 506
 Release Date: 2000.05.03 11:00 PM
 Operating System: Solaris
 LICENSE INFORMATION
 License ID: bannerware
 User Name: developer
 Company Name: talentsoft
 Web Server IP Address: 198.44.444.44
 Web Server Domain Name: domain-name
 Licensed Number of Concurrent Users: 2
 SERVER CONFIGURATION LOG:
 [Main]
 WebpServerPort=6888
 WebpServerPassword=000000100010
 [Log]
 LogFilePath=/usr/local/webplus/log/
 LogLevel=3
 LogAppend=1
 EchoCGI=0
 EchoForm=0
 EchoSQL=0
 .
 .




Web+®User‟s Guide           38       Chapter 5: Web+ Administration
File Input/Output




Figure 5.6 – File Input/Output

Click the [File I/O] link to display the “File I/O” screen (Figure 5.6). The File I/O section
contains the settings for file manipulation. Nearly all Web+ functions that do any sort of
file manipulation use Logical file paths. By mapping a Logical path to a Physical path on
the computer, security is maintained by disallowing scripts to access any directories other
than those that you‟ve given permission to access. The settings for the File I/O section
are listed below (See chapter 10 for additional details):

 Parameter                 Function
 Logical Path              Web+ commands will refer to files by their Logical path.
                           For example, a webFileDelete may refer to the file
                           /temp/webp3. The corresponding physical path will
                           determine the actual location of the file on the server.
 Virtual Host Name         The virtual host name that will use this logical path. If all
                            host names are to use this path, or if virtual hosting is not
                            used on this server, it should be left blank. Multiple host
                            names may be listed, separated by a vertical bar “|” and
                            wildcards may be used (* and ?).
                           For example, *.webplus.com will match both
                           www.webplus.com, and developers.webplus.com.
                           www?.webplus.com will match www1.webplus.com and
                           www2.webplus.com
 Physical Path             The actual location of the corresponding Logical path. In
                           the previous example, the actual path of the logical file

Web+®User‟s Guide                           39            Chapter 5: Web+ Administration
                         /temp/webp3 might be /usr/local/webplus/temp/webp3.
 Read and Write          Both read and write access can be restricted for a given
 Permissions             Logical/Physical path pair. To prevent read or write
                         access, uncheck the corresponding checkbox.

 Read Password and       If a password is specified for either of these access modes,
 Write Password          then that password must be supplied every time a Web+
                         command attempts to access files associated with this
                         Logical/Physical path pair. If no password is supplied, then
                         none is required.
 Setting File I/O        To add a new Logical/Physical path pair, add the Logical
                         and Paths Physical paths in the appropriate columns. Select
                         which operations can be performed (Read and/or Write),
                         Select Read and Write passwords (if required), and then
                         click [Apply].
                         To delete a Physical path pair, remove the Logical path
                         from the “Logical Path” column, and then click [Apply].
                         To change an entry, modify the existing checkboxes and
                         input fields, and then click [Apply].


Datasources Screen (UNIX)




Figure 5.7– Datasources Screen (for UNIX)

Click the [Datasources] link to display the Datasources screen (for UNIX) (Figure 5.7).
The Datasources section allows the integration of Web+ with different databases. There
can be any number of data sources accessed in Web+. Before adding a data source, you


Web+®User‟s Guide                        40            Chapter 5: Web+ Administration
must create a database using a database program (e.g. mySQL, PostgreSQL, etc.). Please
see the HOW TO_DATABASE in the Web+ installation docs/root directory for a more
detailed description of your Web+ distribution. If you do not set up the database
correctly, you may have problems connecting Web+ to the database. The settings for the
Datasources section are listed below:

Parameter                 Function
Datasource Name         The name of the datasource as defined in the datasource
                        manager. If the datasource name in Web+ is not the same as
                        the one supplied in the manager, Web+ will not be able to
                        connect to and communicate with that datasource.
Select, Insert,         Operations specific to the data source.
Update, Delete and      For example, a data source can have “Read Only” access by
SP (Stored              un-checking the [Insert], [Update], [Delete], and [SP] (Stored
Procedure)              Procedure) options. Insert allows records to be added. Update
Permissions             allows records to be changed. Delete allows records to be
                        removed. SP (Stored Procedures) allows the use of SQL
                        programs stored in the database. Please note that most
                        databases do not support the use of stored procedures
UserID and Password     Enter a password if the data source requires a UserID and
                        password to connect.
DSN Type                Select the appropriate Datasource type: mySQL or Postgres,
                        (Datasource Type)mSQL, or ODBC.

Database                The name of the database that the datasource is connected to.

Host                    The domain name or IP address of the host serving the
                        database. If left blank, “localhost” will be used.
Port                    The port the datasource will use when connecting to the
                        database. If left blank, the default port will be used for that
                        datasource type.
Setting Datasources     To add a new Logical/Physical path pair, add the Logical and
                         hysical paths in the appropriate columns. Select which
                         operations can be performed (Read and/or Write), Select
                         Read and Write passwords (if required), and then click
                         [Apply].
                         To delete a Physical path pair, remove the Logical path from
                         the “Logical Path” column, and then click [Apply].
                        To change an entry, modify the existing checkboxes and
                        input fields, and then click [Apply].


Web+®User‟s Guide                        41           Chapter 5: Web+ Administration
Datasources Screen (Windows)




Figure 5.8 – Datasources (Windows)

Click the [Datasources] link to display the Datasources screen (for Windows) (Figure
5.8). The Datasources section allows the integration of Web+ with different databases.
There can be any number of data sources accessed in Web+. The settings for the
Datasources section are listed below:

 Parameter                             Function
 Datasource Name                       The name of the datasource as defined in the
                                       ODBC Driver manager. If the datasource
                                       name in Web+ is not the same as the one
                                       supplied in the ODBC Driver manager, Web+
                                       will not be able to connect to and
                                       communicate with that data source.
 Select, Insert, Update, Delete and    Operations specific to the data source.
 SP (Stored Procedure)                 For example, a data source can have “Read
 Permissions                           Only” access by un-checking the [Insert],
                                       [Update], [Delete], and [SP] (Stored
                                       Procedure) options. Insert allows records to be
                                       added. Update allows records to be
                                       changed.Delete allows records to be removed.
                                       SP (Stored Procedures) allows the use of SQL


Web+®User‟s Guide                        42            Chapter 5: Web+ Administration
                       programs stored in the database. Please note
                       that most databases do not support the use of
                       stored procedures.
 UserID and Password   Enter a password if the data source requires a
                       user ID and password to connect.
 ODBC Driver Manager   Allows data sources to be setup without using
                       the Windows ODBC manager. Click the
                       [ODBC Driver Manager] button to open the
                       “ODBC Driver Manager” screen.
 Setting Datasources   To add a new Logical/Physical path pair, add
                       the Logical and Physical paths in the
                       appropriate columns. Select which operations
                       can be performed (Read and/or Write), Select
                       Read and Write passwords (if required), and
                       then click [Apply].
                       To delete a Physical path pair, remove the
                       Logical path from the “Logical Path” column,
                       and then click [Apply].
                       To change an entry, modify the existing
                       checkboxes and input fields, and then click
                       [Apply].




Web+®User‟s Guide       43            Chapter 5: Web+ Administration
ODBC Driver Manager (Windows)




Figure 5.9– The ODBC Driver Manager screen (Windows example).

Click the [ODBC Driver Manager] button on the “Datasources” screen. The “ODBC
Driver Manager” screen will be displayed (Figure 5.9). This screen lists all of the data
sources (i.e. databases) that are in the system along with each data source‟s ODBC driver.
The ODBC driver (also known as the “access driver”) tells the server where to find the
database (i.e. the actual, physical location of the database). For example, the data source
called “Webplus_Examples” uses the Microsoft Access driver.
To view a current data source, Click the datasource name and the “ODBC Datasource”
screen will be displayed. To add a new datasource, enter the name of the new datasource,
select an ODBC driver via the drop-down menu, and then click [Add]. The “ODBC
Datasource” screen will be displayed.




Web+®User‟s Guide                          44            Chapter 5: Web+ Administration
The ODBC Datasource




Figure 5.10 – The ODBC Datasource screen (Windows example).

The “ODBC Datasource” screen lists the parameters for each specific data source (i.e.
database). The example pictured in Figure 5.10 lists the parameters for the data source
called “Webplus_Examples”. This particular data source uses the Microsoft Access
Driver, the most commonly used access driver. The settings for the ODBC data source
vary with each Datasource. The settings are listed below:

 Parameter                   Function
 Data Source Name            The name of the data source as defined in the ODBC
                             Driver manager.
 Description                 The description of the data source.
 Database File               The physical location of the database. Click [Browse
                             Server] to locate the required directory.
 System Database Driver      The specific database where the data source is located.
 Settings                     Buffer Size – Maximum amount of memory (in Kbytes)
                              available to the data source.
                              Page Timeout – Amount of time (in minutes) before the
                              web page closes with no input from the user.
                              Read Only – Check this box to allow “Read Only”
                              access.
                             Exclusive – Check this box to prevent access to any user
                             except the System Administrator.


Web+®User‟s Guide                        45            Chapter 5: Web+ Administration
 Setting Datasources          To update the parameters, make any necessary changes
                              and click [Update].
                              To delete the current data source, click [Delete].
                              To cancel the current editing session, click [Cancel].


Mail Configuration




Figure 5.11– Mail Configuration Screen

Click the [Mail] link to display the Mail screen (Figure 5.11). The Mail section contains
the parameters that control how Web+ communicates with a mail server. Setting up this
section properly allows Web+ to immediately inform you of any problems with your
scripts. The settings for the Mail configuration section are listed below.

 Parameter                               Function
 SMTP Server Name                        The name of the mail server
 SMTP Port Number                        Usually 25
 Mail Spool Path                         The directory into which mail is put while it is
                                         waiting to be sent (absolute path)
 Mail Log Path                           The directory into which mail is put after it is
                                         successfully sent (absolute path)



Web+®User‟s Guide                         46            Chapter 5: Web+ Administration
 Mail Error Path                      The directory into which mail is put if there is
                                      an error when trying to send it (absolute path)
 Number of send mail attempts         The number of times Web+ tried to send mail
                                      before putting it in the Mail Error Directory.


WebRun Screen




Figure 5.12 – WebRun Screen

Click the [webRun] link to display the “webRun” screen (Figure 5.12). The webRun
section enables and disables two Web+ commands: webRun and webDLL. These two
commands allow Web+ to run non-Web+ programs on your system. The settings for the
webRun section are listed below:

Parameter                       Function
Enable webRun Command           Un-check to disable the webRun command. This
                                action will prevent any Web+ scripts from being able
                                to run any third-party executables on your system.
WebRun Password                 Enter a password to require a password every time
                                the webRun command is issued.

Enable webDLL Command           You can completely disable the webDLL command
                                by deselecting this checkbox.
WebDLL Password                 Enter a password to require a password every time
                                the webDLL command is issued.


Web+®User‟s Guide                      47            Chapter 5: Web+ Administration
Custom Tags




Figure 5.13 – Custom Tags Screen

Click the [Custom Tags] link to display the “Custom Tags” screen (Figure 5.13). This
screen contains the configurations for using Web+ Custom Tags. Web+ Custom Tags are
tags that are not part of the core Web+ product, but still work with Web+ to perform
many useful tasks. For Web+ to support Custom Tags, they must be properly configured
in the Web+ Server. (See Chapter 11 of this User's Guide and the Web+ Language
Reference for more information on implementing Custom Tags.) The settings for the
Custom Tag section are listed below:


Parameter                               Function
Tag Name                                Enter the name of the custom tag. The tag
                                        name must begin with web_. For example, the
                                        custom tag QueryIpHostName is referred to
                                        as <web_QueryIpHostName ...> in the Web+
                                        script. The corresponding DLL or SO path
                                        will determine the actual location of the file
                                        defining the tag on the server, while the name
                                        of the function as defined in the DLL or SO
                                        file is GetHostName.


Web+®User‟s Guide                       48           Chapter 5: Web+ Administration
DLL Path             The actual physical location of the
                     corresponding file that defines the tag. In the
                     previous example, the physical DLL or SO
                     path of the custom tag QueryIpHostName
                     might be /usr/local/webplus/bin/iphost.dll.
Function Name        The actual function name as defined in the
                     DLL or SO file. In the previous example, the
                     actual function name of the custom tag
                     QueryIpHostName might be GetHostName.
CFX Tag              Determines if the custom tag is a Coldfusion
                     custom tag that uses the CFX API. Check this
                     box if the CFX custom tag is being used. Do
                     not check this box if using Web+ API custom
                     tags.
Adding Custom Tags   To add a new custom tag to the Web+ Server,
                     add the Tag Name, physical paths to the DLL
                     or SO path and add the FunctionName to the
                     appropriate spaces provided, then click
                     [Apply].
                      To remove a custom tag from the
                      configuration, remove the tag name from the
                      “Tag Name” column, and then click [Apply].
                     To change a custom tag, modify the existing
                     checkboxes and input fields, then click
                     [Apply].




Web+®User‟s Guide    49           Chapter 5: Web+ Administration
Web+ Monitor (Windows)




Figure 5.14 – The Monitor screen.

Click the [Monitor] link to display the Monitor screen (Figure 5.14). The Monitor section
contains the settings that balances the request lines (i.e. threads) from the CPU and
manages memory. These functions can counteract program inefficiencies that may cause
data to recall too slowly. The settings for the Monitor section are listed below. (Note:
Clicking the [Help] link in the Monitor section will display additional information such
as the Execution Time, SQL Execution Time, Parameters, CGI Variables, etc.)

Parameter                                      Function
Refresh Web+ Server                            Settings to refresh the Web+ server. The
                                               server can be refreshed at a specific time
                                               point or when the memory reaches a
                                               certain percent of total available memory.
Web+ is Running as a(n)                        Sets whether Web+ runs as a service or is
                                               run via an application server.
Application Server is located at               The physical path to the application server.




Web+®User‟s Guide                         50             Chapter 5: Web+ Administration
                                                                                 SIX

Chapter 6: Virtual Hosting
To setup Web+ for name-based virtual hosting (hosting more than one website on a
server with a single IP address), use the “Webplus Website Manager” tool. This is found
in the Web+ 6.0 program group.

Resources Configuration
The resource configuration screen explains how the virtual directories and websites are
being installed and configured to IIS.

Virtual Host Name
The window shown below (Figure 6.1) asks for the host name of the website being
configured. Only one website may be configured at a time, but each website may have
multiple host names. Separate multiple host names by a vertical bar “|”. Wildcards may
be used (* and ?). For example, *.webplus.com will match both www.webplus.com, and
developers.webplus.com. www?.webplus.com will match www1.webplus.com and
www2.webplus.com. To configure a second (third, etc.) website to use Web+, run the
Website Configuration Setup tool again.




Figure 6.1 – Virtual Host Name




Web+®User‟s Guide                        51                 Chapter 6: Virtual Hosting
Select Website For Default Web Site
Select one from the website where the virtual directory is to be located.




Figure 6.4 – Select Website


Destination Folder
Select the directory or the location where the application should be installed. Click
Browse to select the directory.




Figure 6.5 – Destination Folder Window



Web+®User‟s Guide                          52                   Chapter 6: Virtual Hosting
Confirmation to Install
Incase you wish to change any of the settings entered so far please click the back button
else enter next to continue with the installation (Figure 6.6)




Figure 6.6- Ready to install Web+ window

Installation Completed Successfully




Figure 6.7 – Installed Successfully




Web+®User‟s Guide                         53                  Chapter 6: Virtual Hosting
Programming

This section of the Web+ User‟s Guide contains information relevant to those users who
intend to use Web+ to develop applications. These chapters include the programming
aspect of Web+, examples of writing Web+ scripts and the basics of Web+ commands
and functions. For a complete and detailed listing of Web+ commands and functions,
refer to the Web+ Language Reference.




Web+®User‟s Guide                        54                 Chapter 6: Virtual Hosting
                                                                        SEVEN

Chapter 7: Scripts – WML
Web+ scripts are basically HTML scripts with a few additional commands and functions.
The additional commands and functions are referred to as Web+ Markup Language
(wml) instructions. These files are differentiated from traditional .html files by the .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. Web+ commands in the script
instruct the Web+ application server to retrieve information from databases, perform
mathematical computations and many other powerful functions.

The basic process for creating Web+ scripts consist of four steps. First, create the script
as a file, which can be done with any text editor. Next, save the script to a directory
where Web+ can execute it. Next, check the syntax of the script by running it or applying
the “Check Script” parameter as demonstrated in this chapter. Finally, display the script.
The browser should be able to display the script correctly.

Creating the Script
A Web+ script (.wml file) does not need to contain any special Web+ tags or commands
to execute, so any hypertext file can be used as a Web+ script using the .wml file
extension. For example, create a new file with any text editor and type in the text below:

 <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 executable script root directories. Web+ can only
execute scripts that reside somewhere within the script root directory. When Web+ is first
installed, the default script root directory is: c:\webplus\script\. To continue with the
above example, save the above sample script as hello.wml in the default script root
directory: c:\webplus\script\.

Web+®User‟s Guide                          55                  Chapter 7: Scripts – WML
You can declare other directories from which to run Web+ scripts using the Web+ Server
Manager. (See Chapter 5 on Web+ Administration).

Checking the Syntax (CheckScript)
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+. It works just
like the Script= parameter, but instead of executing the script, Web+ will merely report
the number and type of errors that are found. To check the syntax of the hello.wml script,
type in the following command:

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

Web+ will display the following:

 Congratulations! 0 errors found.



Executing the Script
To execute a script, the Web browser first executes Web+. Next, Web+ passes the name
of the script to the browser. To display the above sample script, call Web+ and include
the name of the script using its logical path name in the URL. See the example below:

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

Web+ will then execute the script, parse any Web+ commands and send final output to
the browser to be displayed. Since there are no Web+ tags in the example script
hello.wml, Web+ will simply pass the file‟s content to the browser for output to the end
user. Web+ will display the following:

  Hello, World!



Web+ Naming and Coding Conventions
Because Web+ works on many different operating systems and platforms, please follow
these basic guidelines:
       1. Use lower case for all path and variable names.

      2.   Web+ Tags follow the following conventions: webMail, webPopOpen,
           webFor, webLocation.

      3.   Web+ Functions follow the            following   conventions:   ClientVarList,
           ParameterExists, ListCount.


Web+®User‟s Guide                          56                  Chapter 7: Scripts – WML
     4.   Type the name “Web+” as “webplus” (without quotes) in all path names and
          scripts.

     5.   Add as many comments as possible so that other developers can read and
          decipher your Web+ code. Comment style is setup in the Web+ server
          Manager “Administration” page.

     6.   Always include a README file for your Web+ applications and Custom
          Tags.

     7.   Do not use spaces or reserved words in Web+ variable names.




Web+®User‟s Guide                       57                 Chapter 7: Scripts – WML
                                                                      EIGHT

Chapter 8: Web+ Tags

Tags are at the root of Web+. Web+ tags are basically statements that make up the Web+
Markup Language. The Web+ Markup Language, which looks and behaves identical to
the Hyper Text Markup Language (HTML), executes commands and calls functions in
Web+.
This chapter provides a brief overview of Web+ tags. For more detailed information on
this subject, refer to the Web+ Language Reference.

Command Tags
Web+ command tags are inserted like regular HTML command tags. The command tags
are “stand alone” commands (e.g., the Horizontal Rule HTML tag is a stand alone:
“<hr>”). The simplest command tag is the <WebBeep> command, which simply causes
the Web+ server computer to cause a beep through it‟s speaker.

Example
 This will make the Web+ server beep.
 <WebBeep>


Statement (Container) Tags
Other tags are containers or statements (e.g., the Bold HTML tag is a container: “<b> …
</b>”). The <WebPrint> tag is the most common Web+ container tag. For each
opening <WebPrint> tag, there must be a corresponding closing </WebPrint> tag. If
there is not a matching closing tag for any Web+ container, then the 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, or a number or
array of values. Variables and variable expressions in Web+ must be enclosed in pound
signs (“#… #”). This is to differentiate Web+ variables from the regular HTML text. To
escape a # symbol, simply apply a second # (“##”) where needed. Web+ 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


Web+®User‟s Guide                        58                      Chapter 8: Web+ Tags
(positive or negative, integer or floating point) and can have up to twelve decimal places
(1.0E-12). Array variables are lists of regular variables. To set the value of a variable, use
the <WebSet> tag:

Example
 <WebSet    #n# = 7> or
 <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 above examples.

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,Schoolmeister,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”


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,
which means 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 can be manipulated or accessed
like a regular variable.For instance, you can set the value of just one array variable with a
simple <WebSet> tag.

 <WebSet #a[1]# = 7>
 <WebSet #a[2]# = “Second”>


Web+®User‟s Guide                            59                        Chapter 8: Web+ Tags
 <WebSet #a[3]# = #a[1] + 5#>

The values of several array values can also be set at once. This is done by 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. (Note: This example will set a[2], a[3], and a[4]
to empty strings (“”). )

 <WebSet #a[]# = “,1,Web+,,,,17”>


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 Manipulation.
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 very easily.

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.

Example
   <WebSet #n# = 7>
   <WebSet #name# = “Frank Susko”>”
   <WebSet #m# = #n#>
   <WebSet #n# = #3 * n + 1#>
   <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 a predefined value for the
expression. So the above example will return the following text:

Web+ Output

Web+®User‟s Guide                            60                        Chapter 8: Web+ Tags
   The value of n is 22.
   My name is Frank Susko.
   The product of m and n is 154.


Functions
Web+ functions are used as expressions and must be enclosed within pound signs. All
functions will return some value. Functions typically take other variables as parameters
and return a value. Finally, some functions will take no arguments. Examples of the
different types of functions are listed below:

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 is used repeatedly, you can
create a separate .wml file with this code, and use the <WebInclude> tag to include it at
the appropriate location in the .wml file. Remember that all Web+ variables are global;
therefore, variables modified by code included with a <WebInclude> will be modified
globally.

Comments
Comments are not displayed to end users, but can be seen if the end user chooses to view
the HTML source. HTML uses a double dash comment (“<!-- … -->”) to allow
programmers to include comments in their code. Web+ uses a triple dash comment (“<!-
-- … --->”) to allow code documentation. (Web+ can also use the double-dash comment
provided this convention has been set in the “Administration” screen of the Web+ Server
Manager. See Chapter 5 “Web+ Administration.”) Web+ will remove anything inside of
a triple (or double) dash comment before being sent to the browser. Therefore, sections of
code that have been commented out will not be sent to the browser.



Web+®User‟s Guide                         61                       Chapter 8: Web+ Tags
Example
   <WebSet #a# = 4>
   <!-- <WebSet #a# = 5> -->
   <!--- <WebSet #a# = 6> --->
   <WebPrint>
   a = #a#
   </WebPrint>


Web+ Output
  a=4




Web+®User‟s Guide                62   Chapter 8: Web+ Tags
                                                                               NINE

Chapter 9: Additional Web+ Functions
Date and Time
Web+ offers several functions associated with dates and times. These functions include
retrieving the current date and time, formatting the date/time display, or calculating
differences between dates. The functions are listed below. (some examples and the
resulting output are included).


 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.
 WeekDay (dateString)                  An integer corresponding to the day of the week
                                       the specified date falls on. (1=Sunday
                                       …7=Saturday, 0=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 a Method.
 TimeFormat (dateString, Method)       dateString formatted as specified by a Method.
 DatePart (Option, dateString)         A subset of the dateString, as specified by an
                                       Option.



Example
 <WebPrint>
 The current date is #CurrentDate()#.<br>
 The current time is #CurrentTime()#.<br>
 The current date and time are #CurrentDate()#
 #CurrentTime()#.<br>


Web+®User‟s Guide                        63            Chapter 10: Database Integration
 Alternate date display: #DateFormat(CurrentDate(),
 “m/d/yy”)#.<br>
 Alternate time display: #TimeForemat(CurrentTime(), “h:n
 AM”)#>br>
 </WebPrint>

Web+ Output
 The current date is 1997-03-07.
 The current time is 15:36:31.
 The current date and time are 1997-03-07 15:36:31.
 Alternate date display: 3/7/97.
 Alternate time display: 3:36 P.M.

Example
 <WebSet #a# = “1997-02-13 3:45:09”>
 <WebSet #b# = “2000-02-13 3:45:09”>
 <WebPrint>
 #DateDiff (“s”, a, b)#,
 #DateDiff (“m”, a, b)#,
 #DateDiff (“h”, a, b)#,
 #DateDiff (“d”, a, b)# </WebPrint>


Web+ Output
 94608000, 36, 26280, 1095



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+®User‟s Guide              64        Chapter 10: Database Integration
Web+ Output
 2000-02-13 3:45:09
 Year = 2000
 Month = 2
 Day = 13
 Hour = 3
 Minute = 45
 Second = 9
 Day of Year = 44



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

 Function                    Returns
 CurrentPath()               The path of the current Web+ script.

 WebGetVersion()             Client Compilation Number | Server Compilation number |
                             ServerType
 GetTempFileName()           The file name of the system level temp file that will be used
                             for File I/O. You must first predefine a Logical and Physical
                             path for \temp\. in The File I/D section of the Server
                             Manager see Chapter 5 for further details.
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+.
Variables                       Explanation
SERVER_SOFTWARE                 The name and version of the information server software
                                answering the request (and running the gateway).
                                Format: name/version.


Web+®User‟s Guide                         65           Chapter 10: Database Integration
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.
                    Scripts can be accessed by their virtual path name,
                    followed by extra information at the end of the 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 “ ? ” in the URL that
                    references the script. The variable is called 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 variable 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, the variable is the protocol-specific
                    authentication method used to validate the user.
REMOTE_USER         If the server supports user authentication, and the script
                    is protected, the variable is the user name they have
                    authenticated as.
REMOTE_IDENT        If the HTTP server supports RFC 931 identification,
                    then this varable 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, the variable is the content type of
                    the data.


Web+®User‟s Guide             66            Chapter 10: Database Integration
Web+ Configuration
The following functions and tags relate to the current configuration of the Web+ server.

webIniGet Function
The webIniGet function will return the current value of the specified Web+ key name in
the Web+ configuration file (webpsvr.conf for UNIX, webpsvr.ini for Windows). If an
administration password is required, it will need to be passed to the function as well.
 webIniGet (webpluskeyname[,AdminPassword])


webIniPut Function
This function will set a Value to a KeyName in a specified SectionName of the
webpsvr.ini file. Note: when a key is changed in this manner, it does not go into effect
(i.e. it is not loaded into the Web+ server memory) until a <WebIniRefresh> command is
called. However, the actual configuration file (webpsvr.conf for UNIX, webpsvr.ini for
Windows) is immediately updated. This function returns “1” on success.
 webIniPut (SectionName, KeyName, Value
 [,Password=AdminPassword])

<WebIniRefresh> Tag
After using the webIniPut function, the webIniRefresh tag can be used to load the latest
changes in the Web+ server configuration file into memory to take effect. (The
configuration file is webpsvr.conf for UNIX, webpsvr.ini for Windows.) If an
AdminPassword has been specified in the webpsvr.ini file, it must also be present in the
command.

 <WebIniRefresh [password=AdminPassword]>


Example
 <WebPrint>
 The Admin E-mail Address:
 #WebIniGet (“AdminEmail”,“webplusPW”)#.<br>
 #WebIniPut (“Admin”, “AdminEmail”,
 “admin@domain.com”, “webplusPW”)#
 </WebPrint>
 <WebIniRefresh password=”webplusPW”>

Web+ Output
 The Admin E-mail Address: admin@domain.com




Web+®User‟s Guide                          67           Chapter 10: Database Integration
Web+ Cache Technique
Web+ adopts cache techniques to improve performance. The user can define the size of
the cache Web+ can use to hold .wml script files in memory.

When the 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 use the content in cache to execute. This can
save a lot of input/output time and boost performance. If the update time of this file is
different from the one cached, Web+ will simply dump the cached file content and load
the file into 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 least used script out of cache until enough space is found or
there is nothing in cache. If there is nothing in cache but the space is still not large
enough, Web+ will simply load the file into a thread private memory area to execute
without caching.

Web+ cache is especially useful when your script file is encrypted. Web+ will decrypt it
while loading into cache. This will save a lot of time and increase performance, compared
to loading and decrypting the file every time.


Client State Variables and Functions
Using Client State procedures, variables can be made to persist from script to script by
being saved in the server‟s Window‟s registry, or by being saved in files on UNIX
platforms, indexed with a user ID. The benefit 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. (See the Web+ Language Reference.)

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

Simply issuing the command <WebClient> will enable 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 the
session with which they are associated. The Persistent parameter defaults to “1”, which
enables Client State Variables. To turn client state variables off, set Persistent=0. Client
state variables are managed on a per user basis. UCID is used to specify what the user ID
is for a set of client variables. By default, the way that Web+ keeps track of the user ID is
by setting a cookie on the browser. This can be overridden by changing the setting of


Web+®User‟s Guide                             68             Chapter 10: Database Integration
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, which will cause 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 variables not associated
with any session name are accessible.

   #client.Variablename#

When a session is started, three system variables are created: 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


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              Deletes the specified variable associate with the current
                               (“client.VariableName”) 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




Web+®User‟s Guide                           69            Chapter 10: Database Integration
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 (if allowed). The browser
will maintain the cookie until a preset expiration parameter is reached. Cookie variables
can be set and retrieved by Web+ very easily with just a few functions. Cookies are set
using the <WebCookie> command.
 <WebCookie Name=CookieName Value=CookieValue
 Expires=Expiration Secure=SecurityOption>

Cookie variables have a Name that 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, immediately
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. Specify “NEVER” to have the cookie never
expire. The Secure parameter can also specify the security requirements for a cookie. (if
the browser does not support SSL security, the cookie will not be set).

To retrieve a cookie that has already been set, simply append the cookie variable name to
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#.


Web+®User‟s Guide                         70            Chapter 10: Database Integration
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.


Sockets and Ports
Sockets
Sockets are the interfaces that an application uses to communicate with another host
machine. In order for Web+ scripts to communicate with another machine, there must be
an open socket to communicate through.

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 Protocol (SMTP)
   79                     Finger
   80                     Hypertext Transfer Protocol (HTTP)



Opening a Socket
To open a socket for exchanging information, the <WebSocketOpen> command must
first be issued.


Web+®User‟s Guide                         71          Chapter 10: Database Integration
 <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. The
TimeOut parameter sets the specified amount of time that the socket should remain open.
The TimeOut parameter overrides the time out setting in the webpsvr configuration file
(webpsvr.conf for UNIX or websvr.ini for Windows).

Interacting With a Socket
To send text to the opened socket, the <WebSocketSend> command must be used. To
call 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 is important to note that in most
instances, outbound 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 was not closed
in this manner, it will usually be timed-out by the server or as set by the
<WebSocketOpen> TimeOut parameter.

 <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” 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.


Web+®User‟s Guide                          72            Chapter 10: Database Integration
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>




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




Web+®User‟s Guide                          73            Chapter 10: Database Integration
 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 [, Password])


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 configuration file (wsebpsvr.conf
for *nix or webpsvr.ini for Windows). The Method parameter determines which date and
time you want to know. Valid values are “Modified” and “Accessed”.

 a12345 = Any Variable
 a12345 = Any Variable

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.

IsNumeric
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


Web+®User‟s Guide                           74            Chapter 10: Database Integration
 1
 0

ParameterExists
If a variable has been defined, this function will return a value of 1. This is useful in
situations where a number of variables have 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 treat 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
Modern web browsers allow a user to upload files through the World Wide Web. This is


Web+®User‟s Guide                         75            Chapter 10: Database Integration
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. For 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 action button. The end user can use the action 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.

Example
 <WebPrint>
 Original file name (userfile)=#userfile#<br>
 Web+ assigned name (uploadFile)=#uploadFile(userfile)#
 </WebPrint>


Web+ Output

  Original file name (userfile)=D:\Netscape\Program\bookmark.htm
  Web+ assigned name (uploadFile)=\Temp\webp5


ValidateCC
This function 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)




Web+®User‟s Guide                           76            Chapter 10: Database Integration
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>




Web+®User‟s Guide              77         Chapter 10: Database Integration
                                                                                  TEN

Chapter 10: Database Integration
Executing Queries with Web+
Query commands are used to obtain information from a database. The tag
<webDbQuery> is used to execute a query. The <WebDbQuery> tag requires two
parameters: the datasource of the database to query and the SQL statement to send it.
Three optional parameters may also be assigned. The name parameter may be used so the
query can be referenced. The MaxRows parameter may be used to limit the number of
rows to be returned by the query.
The TimeOut parameter (in milliseconds) may be used to limit the amount of time spent
executing a query. (Note that most ODBC drivers do not support the TimeOut
parameter.)
Debug parameter may also be included for Web+ to display information about the query
for debugging purposes. StartRow is an attempt to use ODBC's cursor feature if
available.

 <WebDbQuery DataSource=DataSourceName[Name=QueryName]
 [StartRow=Number] 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 Debug >



Printing Query Results
To output (print to screen) the results of a query, use the <WebPrint> tag and supply the
name of the query whose results you want to display.

 <WebPrint query=Queryname>
Everything between the <WebPrint> tag and the corresponding </WebPrint> container
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 (provided there are no other variables with which it could be confused). If you


Web+®User‟s Guide                         78            Chapter 10: Database Integration
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 another <WebPrint query=…> loop for greater simplicity and
granular control. Using the startRow parameter, Web+ lets you specify which row to start
<WebPrint query=…> loop.

 <WebPrint query=Qryname [startRow=rowNo.]
 [MaxRows=MaxNo.ofRows] [Group=GroupByName]>


MaxRows describes the maximum number of record rows to be displayed in the output
section. Group is the name(s) of the database column(s) by which Output will be
grouped.

 #QueryName.RecordCount#

RecordCount will return the number of records returned by the query specified by
QueryName. The following example demonstrates how to print the results of a query. It
uses the WebPlus_Examples database. This database contains a table called Addresses,
which itself has fields called “FirstName”, “LastName” and “City”. The datasource name
for this database is called “WebPlus_Examples” (All names are fictitious).

Example
 <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..


Web+®User‟s Guide                         79           Chapter 10: Database Integration
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. The example below uses
the same data as the example above.

Example
<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.‟




Web+®User‟s Guide                          80            Chapter 10: Database Integration
                                                                             ELEVEN

Chapter 11: File Manipulation
Web+ allows the addition of any number of Logical and corresponding Physical file
paths. These paths control where users may access files. A Logical path provides a way
to refer to an actual Physical path on the server. By providing a separation between the
two, files can be moved to new locations without having to rewrite any scripts. Different
Logical paths can have different read and write passwords in order to provide further
control over which directories can be accessed. Logical paths and Passwords can be
created and modified via the Server Manager (See chapter 5 of this User‟s Guide).


Maintaining Paths for File I/O
To maintain the paths for file input and output, log into the Server Manager (see Chapter
5 Web+ Administration for instructions). Next, click the [File I/O] link. Figure 11.1
shows the “File I/O” screen where there is the list of all existing file paths. At the bottom
of the list, there is a text box where new file path details 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 required). If a password field is left blank, then no password will
be required to perform that access. After these settings have been filled in, click [Apply]
and the page will reload. When it does so, the new file path should be displayed. Finally,
click [Logout] and Web+ will be ready to use the new file path.




Figure 11.1 – The File I/O screen.



Web+®User‟s Guide                           81               Chapter 11: File Manipulation
Directories
Web+ offers the ability to create, delete, and move between directories. Each function in
this section contains at least one parameter that references a physical directory

Current Directory
To determine the current working directory, call this function with no parameters. The
function returns the current physical directory.
 webCurDir()


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

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

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

 webRmDir(DirectoryName)


The webRmDir tag can remove directories that are not empty if the Recursive
parameter =1.The webRmDir tag can remove only empty directories if Recursive = 0

 <WebRmDir Path=... Password=#writePasswd# Recursive=1
 Ret=#rt#>




Web+®User‟s Guide                          82              Chapter 11: File Manipulation
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


Files
Web+ offers the ability to perform file manipulation and handling. Each function in this
section contains at least one parameter that references a file on the server. These
references use logical paths and, hence, are subject to the Logical/Physical path
combinations specified in the “File I/O” section of the Server Manager.

Copy File
The FromFile parameter specifies the existing and desired logical path and file name. The
ToFile parameter specifies the existing and desired logical path and file name. 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.

 <WebFileCopy FromFile=sourceFileName
 ToFile=destinationFileName
 [Ret=#result#][FromPassword=ReadPassword]
 [ToPassword=WritePassword]>




Web+®User‟s Guide                           83               Chapter 11: File Manipulation
Example
 <WebFileCopy FromFile=”/log/webplus.log”
 ToFile=”/log/newwebplus.log”
 FromPassword=”webplus” ToPassword=”webplus”>


Rename / Move Files
The FromFile parameter specifies the existing and desired logical path and file name. The
ToFile parameter specifies the desired logical path and file name. If Web+ successfully
renames the file, Ret is 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. By default,
overwrite will have value 0. Setting to 1, Web+ erases the destination file if it already
exists.
 <WebFileRename FromFile =oldFileName ToFile=newFileName
 [Ret=#result#] [FromPassword=ReadPassword]
 [ToPassword=WritePassword] [OverWrite=1|0]>

Example
 <WebFileRename FromFile=”/log/newwebplus.log”
 ToFile=”/log/new2webplus.log”
 FromPassword=”webplus” ToPassword=”webplus” OverWrite=1>



File Input/Output
Web+ can read from and write to files stored on the server. The specific files Logical and
Physical paths as well as Read and Write passwords can be specified in the “File I/O”
section of the Server Manager. (See Chapter 5 Web+ Adminstration.)

Opening Files for Input and Output
Use the <WebFileOpen> command to open a file for input or output.

 <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, which 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.

Web+®User‟s Guide                            84               Chapter 11: File Manipulation
If a password is specified in the configuration 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 these functions to work
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. File is the handle of the existing opened file to read from. Result is the
variable into which the character will be put.
The example below will open the Web+ log file for input and display its contents.


 <WebFileGetChar File=MyHandle Result=#c#>
 <WebFileGetLine File=MyHandle Result=#string#>

Example

 <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>


Web+®User‟s Guide                          85               Chapter 11: File Manipulation
Writing To a File
Two functions, <WebFilePutChar> and <WebFilePutLine>, will write data to an
opened file. 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. File is the handle of the existing opened file to write to. Value is the
character or string to be outputted to the file. The example below will open the Web+ log
file and append a line of text to it.

 <WebFilePutChar File=MyHandle Value=#c#>
 <WebFilePutLine File=MyHandle Value=#string#>


Example
 <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>

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]>


.conf and .ini Files
A .conf file is a configuration file and is used in the UNIX environment. An .ini file is an
initialization file and is used in the Windows environment. Both types of files store
settings and configuration variables for Web+ applications. The .conf and .ini files
consist of keys and values organized into sections. Section names are enclosed in
brackets, and keys are names associated with values.
 [SectionName]
 KeyName=Value


There are two Web+ functions that make working with .conf and .ini files easy. These
functions are <WebGetProfile> and <WebPutProfile>. The function <WebGetProfile>
will get a key value from a .conf or .ini file and <WebPutProfile> will put a key‟s value
in a .conf or .ini file.



Web+®User‟s Guide                            86                Chapter 11: File Manipulation
<WebGetProfile>
This command searches a .conf or .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 .conf or .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 (for UNIX)
 <WebGetProfile File=”/webplus/guestbook/guestbook.conf”
 Section=”Message” Key=”LastLine” Result=#numlines#
 Password=”webplus”>
 <WebPrint>
 There are #numlines# lines in the guestbook.
 </WebPrint>

Example (for Windows)
 <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 (for both UNIX and Windows)
 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 Value=#ValueString# [Size=BufferSize]
 Password=ReadPassword>


File is the file name of the .conf or .ini to be written to (and is subject to the logical path
names specified in the FILE I/O section of Web+ server Manager Application). Section is


Web+®User‟s Guide                            87               Chapter 11: File Manipulation
the section name that the key should be found in (if it exists) and Key is the name of the
key itself. Value 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 (for UNIX)
 <WebSet #s# = #”<font size=-1>” & CurrentDateTime() & “ :
 </font>Web+: This is a test message.”#>
 <WebPutProfile File=”/webplus/guestbook/guestbook.conf”
 Section=”Message” Key=”3" Value=#s# Password=”webplus”>
 <WebPutProfile File=”/webplus/guestbook/guestbook.conf”
 Section=”Message” Key=”LastLine” Value=”3"
 Password=”webplus”>

Example (for Windows)
 <WebSet #s# = #”<font size=-1>” & CurrentDateTime() & “ :
 </font>Web+: This is a test message.”#>
 <WebPutProfile File=”/webplus/guestbook/guestbook.ini”
 Section=”Message” Key=”3" Value=#s# Password=”webplus”>
 <WebPutProfile File=”/webplus/guestbook/
 guestbook.ini” Section=”Message”
 Key=”LastLine” Value=”3" Password=”webplus”>




Web+®User‟s Guide                           88               Chapter 11: File Manipulation
                                                                       TWELVE

Chapter 12: Web+ Custom Tags
What are Custom Tags?
Custom tags are 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.

Because Custom tags are very general component architecture for Web+, they can be
used to solve a huge range of programming problems.

Common Uses of Custom Tags
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 the Web+ API). The Web+ Application Programming Interface is a
C++ based API for creating custom tags. These custom tags are implemented as DLLs for
Windows 2000/XP/2003 or shared objects (.SOs) for UNIX platforms. (Custom tags can
 handle any number of custom parameters, generate Web+ queries to interface with non-
ODBC based information sources, dynamically generate HTML to be returned to the
client and set variables within the Web+ application page from which they are called.
The possibilities are limitless.
Custom tags can be used to solve common programming problems such as converting
text from upper case to lower case, formatting text inputs and performing more complex
functions. You can also build tags that are mini utilities for Web+ development such as a
tag to read the Web+ error log.

Custom tags can also be used to wrap complex client-side capabilities within a tag-based
interface. For example, you could use Dynamic HTML to build a drag-and-drop
animation control that a user could put on his web page with a simple tag. You can also
wrap Web+, JavaScript and HTML together to create “intelligent and reusable form
controls”.

Companies building commercial applications with Web+ can create custom tags to create
tag-based APIs for their applications. This feature will enable other Web+ developers to
take advantage of and extend their own applications through custom SDKs and
programming kits.



Web+®User‟s Guide                         89            Chapter 12: Web+ Custom Tags
Web+ also has the ability to utilize existing ColdFusion Custom Tags. These are set up in
the same manner as standard Web+ Custom Tags in the “Custom Tags” screen of the
Server Manager (Windows-based systems only).

Custom tags help facilitate rapid development within teams of Web developers by
providing a bridge between layout designers and developers. 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, significantly reducing time to production.

See Chapter 5 of this Guide and the Web+ Language Reference for more details on
Custom Tags.




Web+®User‟s Guide                         90            Chapter 12: Web+ Custom Tags
                                                                      THIRTEEN

Chapter 13: Encryption
The purpose of encryption is to prevent unauthorized use and changes to proprietary
source code. Encryption is especially important for commercial applications where
scripts are distributed via the Web.

The wmlencode.exe executable file is used to encrypt source code. The general syntax is
described below. The [-r] parameter tells the computer to recursively encrypt files under
the subdirectory.

 wmlencode [-r] source [destination]


The source can be an individual file name (filename.wml), a group of files with the same
extension (*.wml), or a group of files within a specified directory (directoryname/*.wml).
The destination can be an individual file name (filename.wml), a group of files with the
same extension (*.wml), or a specified directory (directoryname). If the source and
destination directories are different, Web+ will encode the files in source and write them
to destination with the same file names. If the source and destination directories are the
same, Web+ will use .ewm as the extension.




Web+®User‟s Guide                          91                     Chapter 13: Encryption
                                                                      FOURTEEN

Chapter 14: Integration
This chapter covers information about Web+ 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 the configuration
file (webpsvr.conf for UNIX and webpsvr.ini for Windows), or by disabling the webRun
command from within the webRun application in the Server Manager.

 <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
OutVa r 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 the configuration file. If the password does not exist, none is
required (Note: The configuration file is webpsvr.conf for UNIX and webpsvr.ini for
Windows).

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



Web+®User‟s Guide                          92                       Chapter 14: Integration
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 configuration file, then it must follow the Password parameter. If the
operation is successful, retVar will be set to 1 (Note: The configuration file is
webpsvr.conf for UNIX and webpsvr.ini for Windows).

The following DLL example will use the hypothetical mytest.dll, source code. The
example Web+ script will call the DLL, which in turn will output a line of HTTP text and
then set a variable. Webpapi.h is a header for the Web+ functions, which is included with
Web+. It can be found in the c:\webplus\bin directory.

mytest.dll source code

 #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”);}

Example
 <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


Web+®User‟s Guide                         93                     Chapter 14: Integration
                                                                     FIFTEEN

Chapter 15: Other Web+ 6.0 features
<WebTry> <WebCatch> Tag
Error trapping is made possible using <WebTry> <WebCatch> tags in Web+. Also the
enable trapping flag has to be set to “yes” inside the Web+ server manager on the
administration page. <WebTry> <WebCatch> is a pair of tags that are used to catch a
webplus error and print a user friendly message at the user interface.
 <WebTry>
 Block Of Code
 <WebCatch>
 ......
 </WebCatch>
 </WebTry>

Example
 <WebTry>
 code ....
 code ....
 code ...
 webcatch type="system">
 <webif #Error.ErrorCode = 100233#>
 <webprint>
 Error 100233 Caught!
 </webprint>
 </webif>
 </webcatch>
 </Webtry>



Support for XML
To build the XML DOM model

 <WebXMLParse XMLDoc="....." DomNode=RootName
 enableNameSpace=0|1] Ret=#rt#>
 </WebXMLParse>

OR




Web+®User‟s Guide                      94      Chapter 15: Other Web+ 6.0 features
 <WebXMLParse DomNode=RootName
 [EnableNameSpace=1|0] Ret=#rt#>
 XML content string
 </WebXMLParse>


Remarks The error is held by the variable #Error.ErrMsg#

Example
 <WebSet #xmldoc# = "<Book><Title
 A1=""1122"">XML
 Introduction</Title><Author>Mark
 </Author>
 <Author>Luis</Author>
 <Book>">
 <WebXmlParse XmlDoc=#xmldoc#
 DomRoot=BookRoot Ret=#rt#>
 </WebXmlParse>
 <WebIf #!rt#>
 Parse XML error!<BR>
 <WebAbort>
 </WebIf>
 <WebSet
 #Children#=#BookRoot.Children()#>
 <WebPrint>
 Number of children for root:
 #ArrayCount(Children)#<BR>
 </WebPrint>
 <WebSet #Attrs# =
 #BookRoot.Attributes()#>
 <WebPrint>
 Number of Attributes:
 #ArrayCount(Attrs)#<BR>
 </WebPrint>
 <WebFor #I#=0 to #ArrayCount(Children)-
 1#>
 <WebPrint>
 TagName:#Children[I].TagName()#<BR>
 </WebPrint>
 </WebFor>
 <WebSet #Nodes# =
 #BookRoot.GetNodesByTagName("Author")#>
 <WebPrint> Number of Nodes:
 #ArrayCount(Nodes)#<BR> </WebPrint>
 <WebFor #I#=0 TO #ArrayCount(Nodes)-1#>
 <WebPrint>Author:
 #Nodes[I].GetText()#<BR></webPrint>
 </WebFor>



Web+®User‟s Guide                        95      Chapter 15: Other Web+ 6.0 features
Web+ Output
 Number of children for root: 1
 Number of Attributes: 0
 TagName:Book
 Number of Nodes: 1
 Author: Mark



Web+ WML DOM methods
Description From the above sample, you can see that there are several methods for the
            Node (or Tag) to facilitate the browsing of the DOM model. For more
            information on this refer to the Web+ Language Reference.

<webXMLToQuery> Tag

 <WebXMLToQuery XmlNode=Node-Name
 TagName=Tag-Name QueryName=Query-Name Ret=#rt#>

It will convert the XML DOM from Tag-Name to a query object, so you use <webPrint
Query=...> to make a query . Note that when an XML DOM is converted to a query from
Tag- Name, all its attributes and sub tags will be the query object's column names.

Example
 <WebXmlParse DomRoot=BookRoot Ret=#rt#>
 <orders>
 <order order_number="2233">
 <customer>
 <name>John Smith</name>
 <custID>192883</custID>
 </customer>
 <item>
 <name>Fly Swatter</name>
 <price>9.99</price>
 </item>
 </order>
 <order order_number="2234">
 <customer>
 <name>Candice Calloway</name>
 <custID>827145</custID>
 </customer>
 <item>
 <name>Fly Paper</name>
 <price>15.99</price>


Web+®User‟s Guide                       96      Chapter 15: Other Web+ 6.0 features
 </item>
 </order>
 <order order_number="2235">
 <customer>
 <name>Mandy Jones</name>
 <custID>998022</custID>
 </customer>
 <item>
 <name>Mosquito Netting</name>
 <price>38.99</price>
 </item>
 </order>
 </orders>
 </WebXmlParse>
 <WebIf #!rt#>
 Parse XML error!<BR>
 <WebAbort>
 </WebIf>
 <WebXmlToQuery QueryName="test"
 XmlNode=BookRoot
 TagName="item" Ret=#rt#>
 <WebIf #!rt#>
 Error changing to query!<BR>
 <WebAbort>
 </WebIf>
 <WebPrint Query="test">
 Name: #name# ; Price: #price#<BR>
 </WebPrint >

Web+ Output
 Name: Fly Swatter ; Price: 9.9
 Name: Fly Paper ; Price: 15.9
 Name: Mosquito Netting ; Price: 38.99




Web+®User‟s Guide              97    Chapter 15: Other Web+ 6.0 features
                                                                        SIXTEEN

Chapter 16: Internationalization
Web+ UTF-8 support
Description To enable Unicode.
Syntax     <webCharacterEncoding EncodingName="UTF-8"|"UTF8">

Remarks     Once this is given, all the Web+ functions, database queries, etc are utf-8
            based. The recommended place for this tag is in webp_global.wml as the first
            web+ tag.
Note        You can disable UTF-8 by doing <webCharacterEncoding
            EncodingName="Any string other than UTF-8 or UTF8"
Example     UTF-8 aware Web+ query

          <WebCharacterEncoding EncodingName="UTF-8">
           <WebSet #NPrefix# = #WebDataSource("SQLDB",
                   "UnicodeLiteralPrefix")#>
          <WebDbQuery Name="Test" SQL="SELECT * FROM XY WHERE
          w like #NPrefix#'%争议最大%'" DSN="SQLDB">
           <webPrint Query="Test">
            #c1#<BR>
            #c2#<BR>
            </webPrint>



          SQL Unicode Literal prefix

Description For some databases (like SQL Server), it is required to prefix the Unicode
               literal so that the database engine can handle unicode query properly.

Syntax       Microsoft SQL Server requires to use 'N' to indicate a unicode literal in
             SQL statement like:
             SELECT * FROM Person WHERE FirstName=N'%争议最大%'"
             In Web+, this prefix needs to be defined from the datasource setting in
             webpsvr.ini as:

             [ODBC]
             SQLDataSource1=SQLDB
             SQL_Select1=1


Web+®User‟s Guide                          98           Chapter 16: Internationalization
           ....
           SQLUnicodeLiteralPrefix1=N

           Web+ automatically converts UTF-8 literals into UTF-16 if the backend
           database (like SQL Server) requires UTF-16, and convert UTF-16 literal
           back into UTF-8

UTF-8 aware Web+ stored procedure
               <!---
               create procedure unicode_SP
                     @FirstName nvarchar(50),
               @LastName nvarchar(50) OUTPUT,
                       @FullName nchar(100) OUTPUT
               as
               select @FirstName FirstName, @LastName LastName
               set @FullName = @FirstName + ' ' + @LastName
               set @LastName = @FirstName

               declare @LastName nvarchar(50),@FullName
               nchar(100)
               set @LastName=N'昨日控辩双方'
               exec unicode_SP N'梁金国', @LastName OUT,
               @FullName OUT
               select @FullName, @LastName
            --->

        <WebDbProcedure Procedure="unicode_SP"
                DSN="SQLDB">
         <webDBProcedureResult Name="xref" ResultSet="1"
                StartRow=1 MaxRows=1>
         <WebDbProcedureParam Type="IN"
                InValue="昨日控辩双方"
                SQLType="SQL_WVARCHAR"
                DbVarName="@FirstName" MaxLength="50">
         <WebDbProcedureParam Type="INOUT"
                InValue="梁金国" SQLType="SQL_WVARCHAR"
                DbVarName="@LastName"
                OutVar=#ChangedLastName#>
         <WebDbProcedureParam Type="OUT"
                SQLType="SQL_WCHAR" DbVarName="@FullName"
                MaxLength="100" OutVar=#FullName#>
         </WebDbProcedure>


Web+®User‟s Guide                      99           Chapter 16: Internationalization
         <webPrint Query="xref">
             #FirstName#, #LastName#<BR>
         </webPrint> <webPrint>FullName=#FullName#
         </webPrint><BR>
                <webPrint>LastName=#ChangedLastName#
         </webPrint>




Unicode aware string functions
         The following Web+ functions are unicode aware when utf8 is enabled.

Syntax                                    Description
#Len("飓风让美国改")#                           Now returns the number of
                                          unicode characters in the
                                          string instead of number of
                                          bytes.

#Left("飓风让美国改变", 2)#                      Is to get the left two
                                          unicode characters in the
                                          string instead of bytes.

         The same for #Right(...)#, #Mid(...)#, #InStr(...)#,
         #LCase(...)#,#UCase(...)#,#Reverse(...)#,
         #RemoveChars(...)#,#Insert(...),

Example UTF-8 aware Web+ string functions:
    <webCharacterEncoding EncodingName="UTF-8">
    <webPrint>
   Len=#Len("飓风让美国改变 逼布什扩军权逼百姓节能源")# <BR>
   Left=#Left("飓风让美国改变", 2)#<BR>
   Right=#Right("飓风让美国改变", 3)#<BR>
   Mid=#Mid("飓风让美国改变", 0,3)#<BR>
   InStr=#InStr(1,"飓风让美国改变 逼布什扩军权逼百姓节能源",
  "美国", 1)#<BR>
    LCase=#LCase("ABC飓风让美国改变")#<BR>
    UCase=#UCase("abc飓风让美国改变")#<BR>
  RemoveChars=#RemoveChars("飓风让美国改变 逼布什扩",3, 20)#<BR>



Web+®User‟s Guide                      100          Chapter 16: Internationalization
  Insert=#Insert("飓风", "飓风让美国改变 逼布什扩", 5)#<BR>
  Reverse=#Reverse("飓风让美国改变 逼布什扩")#<BR>
             </webPrint>



    Web+ regular expression that are unicode aware are

<webRegexMatch ..>,<webRegexReplace ..>,<WebRegexSplit..>

         UTF-8 aware Web+ regular expression tags:

         <WebRegexMatch
         Subject="加拿大各省官员访华争夺中国游客"
         Pattern="/.*(各省).*(访华).*(中国).*/"
         MatchesToFind=-1 MatchesFound = "myfound"
           Ret=#Rt#>
         <webIf #Rt#>
         <webPrint>   #myfound.Matched.SubString[1]#.
         #myfound.Matched.SubString[2]#,
         #myfound.Matched.SubString[3]#
         </webPrint><BR>
         <webElse>
         Found nothing <BR>
          </WebIf>

          <webRegexReplace
          Subject="AA2001-08-18E2001-08-19BB"
          Pattern="/([0-9]{4})-([0-9]{1,2})-([0-
          9]{1,2})/"
          ReplacedTo="英特警突袭按摩房 营救日本中国少女性奴"
          Result=#replaced#>
          <webPrint>
          #replaced#<BR>
          </webPrint>


          <webSet #Subject# = "中国正在庆祝 预计,新的计划">
           <WebRegexSplit Subject=#Subject#
           Pattern="/[\s,]+/"     Offset=0
           SplittingsToMake=-1
           SplittingsFound="splitted">


Web+®User‟s Guide                     101            Chapter 16: Internationalization
          <webPrint>
          <webSet
           #Num#=#ArrayCount(splitted.SPLITTING)#>
          Number of splittings: #Num#<BR>
           <webFor #I# = 0 to #Num-1#>
          #splitted.SPLITTING[i]#<BR>
          </webFor>
          </webPrint>

CurrencyFormat Function
 Description Displays the given value in the currencyformat
 Syntax      #CurrencyFormat(float expression [,int Decimals,
             str CurrencySymbol [,string thousands_seperator,
             string decimal_point
             [,bool CurrencySymbolPlacement ]]]]) #


   Argument                 Required      Description
   Float expression          Yes       Displays the dollar sign ($).
                                       Displays the number with the
                                       thousands separator (,) if
                                       appropriate. Displays the
                                       negative numbers enclosed in
                                       parentheses. Displays two
                                       digits to the right of the decimal
                                       separator (.).
   Int Decimals               No       Default value= 2
   CurrencySymbol             No       String that would be placed
                                       before or after the expression
                                       ,based                       on
                                       CurrencySymbolPlacement.
                                       Multicharacter    strings   are
                                       returned in their entirety(
                                       without truncating). Default is
                                       “$”
   Thousands_seperator        No       This is the string that would
   Symbol                              group every 3 digits in the
                                       expression. Default is “,”
  CurrencySymbolPlacement              This would be Boolean, where 0
                             No        = “to the left of the expression”
                                       and 1=”to the right of the


Web+®User‟s Guide             102       Chapter 16: Internationalization
                                                         expression”. Default value is
                                                         “0”.


     Example1      <webPrint>#CurrencyFormat(2.583)#</webPrint>
     Web+ Output     $2,58


     Example2      <webPrint>#CurrencyFormat(1000)#</webPrint>
     Web+Output      $1,000.00


     Example3      <webPrint>#CurrencyFormat(5000.237,3,”$”,”,”.”,1)#
                   </webPrint>
     Web+ Output     5,000.237$


     Example4      <webPrint>#CurrencyFormat(100000,2,”DEM”,”.”,”,”) #
                   </webPrint>
     Web+ Output     DEM 100.000,00

NumberFormat Function
   Description       Displays a number value as an integer with the thousand's separators.
   Syntax           #NumberFormat(float expression [, int
                    decimals [, string thousands_seperator, string
                    decimal_point ]])#


            Argument                                                  Description
                                          Required
            Float expression               Yes           The argument Expression is required
                                                         and is the number to be formatted. This
                                                         function can also handle float values.

            Int decimals                   No            Default value is 0
            String                         No            Default value is “,”
            thousands_seperator
            String decimal_point            No           Default value is “.”




Web+®User‟s Guide                          103            Chapter 16: Internationalization
   Remarks          If the thousands_seperator or decimal_point are multichararter strings,
                    then use only the first character .
   See Also         Format, TimeFormat, DateFormat, DatePartFormat,
                    DecimalFormat, DollarFormat, YesNoFormat


   Example1         <webPrint>#NumberFormat(1000)#</webPrint>
   Web+Output       1,000


   Example2         <webPrint> #NumberFormat(1000,2)#</webPrint>
   Web+Output       1,000.00


   Example3         <webPrint> #NumberFormat(1000,2,”.”,”,”)#
                    </webPrint>
   Web+Output       1.000,00


   Example4         <webPrint> #NumberFormat(1000000,3,””,”,”)#
                    </webPrint>
   Web+Output       1 000 000,000




Web+®User‟s Guide                         104             Chapter 16: Internationalization
                                                             APPENDIX A

Appendix A: Web+ Support Services
Webplus,Inc. offers a variety of support options to help you get the most from Web+. The
best way to get answers to your questions is to browse through our Web+ Conference at
http://www.webplus.com. Web+ Conference contains a knowledge base of answers to
many frequently asked questions, descriptions of common problems and information
about new updates and features for Web+. Here you can also post your questions
regarding Web+. Here you can also post your questions regarding Web+.

You can also call our support services between 9:00am - 5:00pm (Central Time, USA),
Monday through Friday, at (651) 209-3100. Please be sure to read all Web+
documentation before contacting Webplus,Inc. support.

Technical Support
E-mail: support@webplus.com
www: http://www.webplus.com

Please note: Webplus,Inc. can not provide technical support for Web+ scripts that were
not included with Web+ or that have been modified in any way outside of the official
web+ documentation. Many questions can be answered within Web+ Developers
forum/Community located at http://www.webplus.com.

Sales Information
For Web+ Sales information, contact the Web+ Sales Manager
Mail: Webplus, Inc.
416 N. Production St.
Aberdeen, SD 57401
USA
Tel: (605) 229-0307
Fax: (605)229-0394
E-mail: sales@webplus.com
www: http://www.webplus.com




Web+®User‟s Guide                        105       Appendix A: Web+ Support Services
                                                                 APPENDIX B

Appendix B: Troubleshooting
This section lists some common errors and possible solutions. Errors that are specific to
the UNIX or Windows architectures are labeled as such. Please review the current
documentation associated with your Web+ distribution.
Error                      Solution
Custom tag error           Not all parameters for the custom tag have legal values.
                           Web+ cannot locate the corresponding custom tag
                           implementation. Make certain that dllPath, funcName both
                           have correct values.
Datasource API error       Web+ cannot call the data source‟s API correctly. Please
(UNIX)                     make sure that the data source supports API and that it is
                           configured correctly.
Datasource EXE error       Web+ cannot correctly execute the data source statement.
(UNIX)                     Verify that the syntax of the SQL statement is correct.
Datasource fetch data      Web+ cannot use the data source‟s SQLFetch command to
error (UNIX)               get data from query result. Please check the data source
                           configuration and the webDbQuery SQL statement for
                           correct syntax.
Datasource naming          Two webDbSets have the same name. Different webDbSets
error (UNIX)               cannot have the same data source name within one session.
                           Make certain that different webDbSets have different data
                           source names.
Datasource not found       Web+ cannot find the specified data source. In order to use
                           data sources with Web+, the datasource must be created in
                           webpsvr.conf manually, or via the datasource section of the
                           Web+ Server Manager. The datasource must also exist and
                           be named within the MySQL or postgreSQL database
                           managers.
Database Stored            The datasource does not support stored procedure
procedure error            mechanisms. Please do not use stored procedure calls.
(UNIX)
Database error:            Database operations have been disabled. Check the
database operations        Datasource section of the Web+ Server Manager and make
disabled                   sure that this un-trusted script is given database access.
Domain name error          Web+ cannot open a TCP/IP connection to the specified host.
                           Verify that the host name specified is correct and that the


Web+®User‟s Guide                         106              Appendix B: Troubleshooting
                          host is available.
Expression runtime        A math expression was attempted with a non-numeric
error                     variable. Verify that each element in the expression is a valid
                          number.
External File Run error   The command line could either not be found or cannot be
                          executed. Verify the syntax of the command line statement
                          and location of the executable.
File read permission      You do not have permission to read from this directory.
denied                    Check the Web+ Server Manager to ensure that you have the
                          proper permissions to perform this operation. Check the File
                          I/O section and verify that the FileRead key is set to “1” and
                          that the FileReadPassword matches that in the script file.
File access error         The file referenced could not be opened. Verify that the file
                          exists in the correct directory and that it is not corrupt. Check
                          the Logical and Physical File I/O paths within the Web+
                          Server Manager.
File path error           Cannot find logical path. The logical path may not be
                          properly mapped to a physical path. Check with the Web+
                          System Administrator to ensure that you have the proper
                          permissions to perform this operation. Check the File I/O
                          section of the Web+ Server Manager.
File write error          File write permission denied. You do not have permission to
                          write to this directory. Check with the Web+ System
                          Administrator to ensure that you have the proper permissions
                          to perform this operation. Check the File I/O section of the
                          Web+ Server Manager and verify that the FileWrite key is
                          set to 1 and that the FileWritePassword matches that in the
                          script file.
Form error: required      There are required fields in the submitted form without data.
fields missing            Use the [Back] button on the web browser to return to the
                          previous page and enter data into the “required” form fields.
License ID error          There is something wrong with the License ID. Verify that
                          the License ID in the Main section of the Web+ Server
                          Manager is exactly the same as the one that appeared in the
                          confirmation email. Contact the Webplus, Inc. Sales
                          department at http:// www.webplus.com if the problem
                          persists.
Missing Web+ script       For Web+ to process a script file, it must be passed as an
file argument             argument. Append the location and the name of the script
                          file  to   the   submitted      URL      in   the    form:


Web+®User‟s Guide                        107               Appendix B: Troubleshooting
                         http://www.domain.com/cgi-
                         bin/webplus.exe?script=/logicalPath/filename.wml.
ODBC API error           Web+ cannot call the ODBC‟s API correctly. Make certain
(Windows)                that the system supports ODBC and that it is configured
                         correctly.
ODBC EXE error           Web+ cannot correctly execute the ODBC statement. Verify
(Windows)                that the syntax of the SQL statement is correct.

ODBC datasource not      Web+ cannot find the specified ODBC datasource
found (Windows)          either because of an incorrect name, or because no default
                         driver has been selected. In order to use ODBC datasources
                         with Web+, the datasource must be created in webpsvr.ini
                         manually, or via the ODBC section of the Web+ Server
                         Manager. If running under Windows NT, the datasource
                         must have been created as a „System DSN‟ in order for it to
                         be available to Web+.
ODBC fetch data error    Web+ cannot use ODBC‟s SQLFetch command to get data
(Windows)                from query result. Please check the ODBC configuration and
                         the webDbQuery SQL statement for correct syntax.
ODBC stored              The ODBC driver does not support stored procedure
procedure error          mechanisms. Do not use a stored procedure call because the
(Windows)                ODBC driver does not support it.
Query error              Attempted to operate on a query that does not exist. Make
                         certain the query is defined.
Script extension error   The script file could not be executed because it has an
                         extension that Web+ cannot recognize. Check the script file
                         extension in Script section of the Web+ Server Manager. If
                         an extension other than the default .wml is required, change
                         this within the Web+ Server Manager.
Script file error        The script file could not be executed because it could not be
                         found or is corrupt. Check the Logical and Physical paths in
                         the Script section of the Web+ Server Manager. Make
                         certain the paths refer to the correct directories. Also, verify
                         the file‟s integrity.
Script runtime error     There is something wrong syntactically or semantically with
                         the script file. Verify that the syntax and semantics of the
                         script file are correct. To run the debug utility, change the
                         format of the URL from: http://domainname/cgi-
                         bin/webplus.exe?script=/scriptpath                        to>
                         http://domainname/cgi-


Web+®User‟s Guide                       108              Appendix B: Troubleshooting
                          bin/webplus.exe?checkscript=/scriptpath
SQL DELETE                You do not have the permission to perform SQL DELETE
permission denied         operations on this datasource. Check the Datasource section
                          of the Web+ Server Manager and verify that the
                          [SQL_Delete] key is checked and that you have the proper
                          permissions to be able to perform this operation.
SQL INSERT                You do not have the permission to perform SQL INSERT
permission denied         operations on this data source. Check the Datasources section
                          of the Web+ Server Manager and verify that the
                          [SQL_Insert] key is checked and that you have the proper
                          permissions to be able to perform this operation.
SQL SELECT                You do not have the permission to perform SQL SELECT
permission denied         operations on this datasource. Verify that the datasource has
                          been entered into the Datasources section of the Web+ Server
                          Manager and that the [SQL_Select] key is checked.
SQL STORED                You do not have the permission to perform SQL STORED
                          PROCEDURE operations on this datasource. Check the
PROCEDURE error
                          Datasources section of the Web+ Server Manager and verify
                          that the[SQL_SP] key is checked and that you have the
                          proper permissions to be able to perform this operation.
SQL UPDATE                You do not have the permission to perform SQL UPDATE
permission denied         operations on this data source. Check the Datasources section
                          of the Web+ Server Manager and verify that the
                          [SQL_Update] key is checked and that you have the proper
                          permissions to be able to perform this operation.
Syntax error              There is at least one syntax error in the script file. Use the
                          Web+ syntax checking function to make sure the script does
                          not have syntax errors. To run this utility, change the format
                          of      the      URL       from:      http://domainname/cgi-
                          bin/webplus.exe?script=/scriptpath                          to:
                          http://domainname/cgi-bin/webplus.exe?
                          checkscript=/scriptpath.
Unbalanced comment        Make certain all Web+ comments begin and end with three
                          dashes or as set up in the Web+ Server Manager.
Variable error: Illegal   An illegal variable name was used. All variable names must
variable name             contain only alphanumeric characters and underscore dashes.
                          Please verify that no spaces, other symbols or Reserved
                          Words are used within the variable name.
Variable error:           Cannot use the variable to do an operation without first
variable not defined      defining the variable. Check the script and make sure that the


Web+®User‟s Guide                       109               Appendix B: Troubleshooting
                       variable is properly defined before being used.
Web+ client/server     The Web+ client (webplus.cgi) cannot properly communicate
communication failed   with the Web+ server (webpsvc.cgi or webpsvr.cgi) because
(UNIX)                 the Web+ server is not running; or the Web+ client/server
                       communication password, IP address, or port number do not
                       match; or the network connection between Web+ client and
                       Web+ server is not working properly. Correct the problem
                       by checking the following:
                       1         Make sure that Web+ is running. If not, try
                       restarting the Web+ server (/webplus/webpadmin start).
                       2       Make sure that the settings for WebpServerIP,
                       WebpServerPort, and WebpServerPassword in webplus.conf
                       and webpsvr.conf match each other.
                       3        Make sure that the Web+ server daemon is properly
                       installed and running. The Web+ server daemon must be
                       running before attempting to submit requests to Web+.
                       4.      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.
Web+ client/server     The Web+ client (webplus.exe) cannot properly
communication failed   communicate with the Web+ server (webpsvc.exe or
(Windows)              webpsvr.exe) because the Web+ server is not running; or the
                       Web+ client/server communication password, IP address, or
                       port number do not match; or the network connection
                       between Web+ client and Web+ server is not working
                       properly. Correct the problem by checking the following:
                       1.       Make sure that Web+ is running. If not, try
                                restarting the service file (websvc.exe) or the
                                executable file (websvr.exe).
                       2.       Make sure that the settings for WebpServerIP,
                                WebpServerPort, and WebpServerPassword in
                                webplus.ini and webpsvr.ini match each other.
                       3.       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+. Note: If the Windows NT service version of
                                Web+ is being used, go to Control Panel | Services,
                                and make sure that the “Webplus,Inc‟s Web+
                                Server” service is started. If so, stop and re-start the


Web+®User‟s Guide                     110              Appendix B: Troubleshooting
                                service. If not, simply start the service. 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 from
                                the Windows „Startup‟ folder.
                        4.      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.
Web+ Server expired     The Web+ License ID has expired. Please contact
                        Webplus,Inc. sales at sales@webplus.com for a new
                        License ID.

Web+ Server              The Web+ server application is not currently running or
application not         is not correctly installed. Make certain that the Web+
available               server is properly installed and running. The Web+ server
                        executable must be running before attempting to submit
                        requests to Web+. To verify that the Web+ server is
                        running, see the process table for webpsvr. To start the
                        server, type /usr/local/webplus/webpadmin start. To
                        restart the server, type /usr/local/ webplus/webpadmin
                        restart.

webDll error            The Web+ Administrator has disabled the webDll function.
                        No DLL functions may be used. Enable the webDll
                        command in the WebRun section of the Web+ Server
                        Manager.
webDll password error   A webDll command was issued without the correct webDll
                        password. Verify that the webDll password in the script is
                        the same as that located in the webDll password box of the
                        WebRun section of the Web+ Server Manager.
webRun error            Cannot issue a webRun command because it has been
                        disabled. Enable the webRun command in the WebRun
                        section of the Web+ Server Manager.
webRun Password         A webRun command was issued without the correct
error                   webRun password. Verify that the password in the script is
                        the same as that located in the webRun password box of the
                        WebRun section of the Web+ Server Manager.




Web+®User‟s Guide                    111               Appendix B: Troubleshooting

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:45
posted:6/20/2011
language:English
pages:111