# Web Server Reference

> Source: https://manual.pvxplus.com/web-server-reference/introduction

The PxPlus Web Server Reference contains technical information to help you set up and use the PxPlus Web Server. The reference is intended primarily as a resource for application programmers and analysts. It is designed to help you with your PxPlus Web Server's installation, configuration and associated Web-based internet programming. Please note that PxPlus Web Server version 1.2 must be used with PxPlus 4.12C or higher.

Before you begin, you will find it helpful to familiarize yourself with the **[Glossary of Common Terms](https://manual.pvxplus.com/web-server-reference/introduction#Glossary)** and the list of descriptive Conventions provided below.

## Glossary of Common Terms

Some of the naming conventions used in the PxPlus Web Server Reference are listed below. In addition, common internet acronyms are expanded to their full terms. See any standard browser manual for detailed definitions of Internet acronyms.

| **Term/Acronym** | **Meaning *(in the PxPlus Web Server Reference)*** |
| --- | --- |
| Base launcher | The basic PxPlus Web Server launcher or engine, responsible for reading the configuration and launching the individual Web servers (port monitors). |
| CGI | Common Gateway Interface. |
| Client/browser | A browser or query engine sending a request for information or tasks. |
| Cookie | A variable=data pair you can use to transfer status and tracking information from one page to another. |
| DNS | Domain Name Server. |
| FTP | File Transfer Protocol. |
| GMT | Greenwich Mean Time. |
| HTML | HyperText Markup Language. |
| HTTP | HyperText Transfer Protocol. |
| IP | Internet Protocol. |
| Port monitor | An individual Web server that monitors a given port or TCP/IP socket. The terms "port monitor", "Web server" and "server" are sometimes used interchangeably in this reference and in the PxPlus Web Server dialogue box prompts on-screen. See **[Port Monitors](https://manual.pvxplus.com/web-server-reference/components-of-the-web-server/overview#port_monitors)**. |
| SMTP | Simple Mail Transfer Protocol. |
| Task handler | PxPlus Web Server application that processes requests from the port monitor and returns completed results to the port monitor. (Task handlers are also referred to as sub-servers.) See **[Task Handlers](https://manual.pvxplus.com/web-server-reference/components-of-the-web-server/overview#task_handlers)**. |
| TCP/IP | Transmission Control Protocol/Internet Protocol. |
| TCP/IP Socket | The number you assign to the port or socket. The typical default socket for a Web server number is 80. Each port monitor must have a unique socket or port number. |
| URL | Uniform Resource Location request. Use standard URL coding conventions for requests to the Web Server. Requests to run PxPlus programs follow standard CGI coding conventions. |
| Web Server | Case-sensitive, mixed case is the PxPlus Web Server application. Any other usage (case insensitive) is a port monitor. The terms "port monitor", "Web server" and "server" are sometimes used interchangeably in this reference and in the Web Server dialogue boxes on screen. |

The word *application* in this reference is a literal term meaning *use/usage*. An application can be as simple as a function, a few lines of code, or a subroutine controlling a process (e.g. creating a Web page) in a single program, or it can be a complex series of programs (e.g. a lead program with sub-programs, a full website, the Web Server).

## Conventions

***Format Conventions***

The following conventions have been applied to the format for each directive in the PxPlus Web Server Reference:

| **Symbol(s)** | **Meaning** |
| --- | --- |
| \[ \] | Square brackets enclose optional elements in the syntax format.  <br>  <br>***Example:***  <br>  <br>With the special HTML code format ~~argument\[?suffix\]~~, you can use either an argument with a suffix (e.g. ~~Total?F:####0.00~~) or just an argument (e.g. ~~Total~~). |
| { } | Curly brackets enclose a list of elements where you must select one item.  <br>  <br>***Example:***  <br>  <br>With {yes\|no}, you must select either *yes* or *no*. |
| \| | Vertical bars **\|** *pipes* are used to separate a series of possible values.  <br>  <br>***Example:***   <br>  <br>{yes\|no} |
| ... | Dots indicate the continuation of a list of elements. |

***Punctuation Conventions***

If you are new to PxPlus, below are some of the punctuation conventions you will see in the syntax in this reference:

| **Symbol(s)** | **Meaning** |
| --- | --- |
| ! | ***Exclamation mark:*** Use the *exclamation mark* in the PxPlus language to begin a programmer's remark. It is syntactically the same as using a REMark directive.  <br>  <br>***Example:***<br>! This is a remark.   <br>REM This is a remark, too. |
| " ... " | ***Double quotes:*** Use *double quotes* to enclose string literals in your PxPlus programs. *Double quotes* are not used in URL syntax.<br>***Example:***  <br>  <br>**?stringvar=abc** in your URL is the equivalent of **stringvar$="abc"** in your PxPlus code. |
| #! | ***Pound sign + Exclamation mark:*** An ASCII CGI program starts with the *pound sign* plus an *exclamation mark*. Use the mime type **application/PxPlus** for ASCII PxPlus programs. CGI programs (other than PxPlus programs) are not currently supported. |
| % | ***Percent sign:*** A leading *percent sign* in your PxPlus program denotes a global variable, as in the Web Server system variables: **%exit_code** and **%print_fn**.   <br>  <br>A leading *percent sign* is also used in Web Server syntax as a prefix for characters that are invalid in HTML but still needed in your transmission to the browser. (Send them as their HTA value, prefixed by the % *percent sign.*) |
| & | ***Ampersand:*** Use the *ampersand* as the separator between arguments in a URL statement.<br>***Example:***  <br>  <br>http://server/myapp/myprog?stringvar=abc&nextvar&a_var |
| \* | ***Asterisk:*** When you include the leading *asterisk* as in **\*web**, PxPlus will prefix your program name with the full path name to the PxPlus lib directory automatically and will change the *asterisks* to *underscores*.  <br>  <br>***Example:***  <br>  <br>\*web/merge would become something like: g:\\software\\pxplus VX.X\\lib\\\_web\\merge.   <br>  <br>You can also use *asterisks* in the PxPlus language to enclose specialty file names, such as \*MEMORY\*, and to serve as operators (e.g., in multiplying value\*1.05 and in 'C'-type operators, etc.). |
| \+ | ***Plus sign:*** Use the *plus sign* in your URLs to encode spaces on the data side of a variable=data pair or spaces between arguments on the variable side (no equals sign).  <br>  <br>***Example:***  <br>  <br>http://www.pvxplus.com/makewish;init?this+that&what=dog+cat+pig<br>(*Plus signs* in your PxPlus language syntax have the usual conventional meanings, i.e. as addition operators, etc.) |
| : | ***Colon:*** Use the trailing *colon* to denote the end of a line label in your PxPlus program. An entrypoint in your URL, such as **yourprog;entrylabel**, refers to the **ENTRYLABEL:** line label in your program where the task handler would start executing your Web application. |
| ; | ***Semi-colon:***  Use the *semi-colon* in an URL to indicate an entrypoint in a program (i.e. a line label where execution should start).  <br>  <br>***Example:***  <br>  <br>call "yourprog;start_here", this_arg,that_arg   <br>http://server/makewish;init?this+that&what=dog+cat |
| \<...> | ***Greater than*** and ***Less than:*** Use *greater than* and *less than* symbols as brackets to enclose special HTML attributes or object tags.<br>***Example in a PxPlus program:***<br>```<br>0020 PRINT (%PRINT_FN)"<html><head>"<br>``` |
| ? | ***Question mark:*** Use a leading *question mark* to denote the start of an argument list in your URL.   <br>  <br>***Example:***  <br>  <br>http://myapp/mypvxprog?myvar&stringvar=abc&anothervar<br>You also use a *question mark* to denote the start of a suffix in a Web Server specialty code in HTML pages.  <br>  <br>***Example:***  <br>  <br>~~Total?F:####0.00~~   <br>~~myprog;filltable?T~~<br>In conventional PxPlus syntax, a *question mark* is the same as a PRINT directive.  <br>  <br>***Example:***  <br>  <br>You can use either ? (%PRINT_FN)"\<html>\<head>" ***OR*** PRINT (%PRINT_FN)"\<html>\<head>" |
| ~~ ... ~~ | Enclosed by ***double tilde:*** Use *double tildes* to enclose Web Server specialty codes in HTML template pages.  <br>  <br>***Example:***  <br>  <br>~~myprog;filltable?T~~ |

## PxPlus Web Server

The PxPlus Web Server is HTTP/1.0 compliant. It lets you integrate your HTML and your PxPlus programs in your Web applications. The PxPlus Web Server's coding standards for an HTML Web page, for running a PxPlus program and passing it data follow standard CGI conventions. You can create HTML using PxPlus and/or using your favourite HTML editor (e.g. MS Word, Frontpage, etc.).

You can use the PxPlus Web Server as your only Web server, or you can use it to augment your existing Web server. For instance, you can use Apache, Microsoft-IIS or Netscape to serve your main site and use the PxPlus Web Server to run your PxPlus Web applications and create Web pages to gain access to your data.

Note:  
If you need to handle responses larger than 700 kilobytes, the recommendation is to use [EZWeb Server](https://manual.pvxplus.com/ezwebserver/ezweb-introduction), [Apache](https://manual.pvxplus.com/apache) or IIS.  
  
If this is not an option, you can set the [PXP_WEB_BSZ](https://manual.pvxplus.com/pxplus-installation-and-configuration/customizing-pxplus/environment-variables#Mark17) environment variable to a value greater than 80 kilobytes (default) to allow PXPlus Web Server to handle larger responses; however, increasing this value will cause the PxPlus Web Server to use more memory.  
  
(PXP_WEB_BSZ functionality was added in PxPlus 2022.)

You can use the PxPlus Web Server to:

- Integrate your PxPlus programs directly with standard Web Server operations.

- Gain direct access to PxPlus data files, ODBC data files and other PxPlus file structures for use in your Web applications (i.e. your PxPlus programs).

- Use almost any PxPlus programming feature in your Web application.

- Give your users access to your Web applications without the time delay of launching a CGI application. (The Web Server accepts and runs CGI-compliant URLs as PxPlus programs.)

- Perform high volume simultaneous request processing (as many as 1,000 at a time) and automatic restarting of stopped/stalled requests.

- Reconfigure your Web server on the fly.

You can transfer files of any size and any type with the Web Server. There is no delay before the file transfer begins. You can also force the browser to "Save As" the file name you specify for display to the user. Transferring files of any size has no effect on memory requirements. (No additional RAM is used.)

## See Also

**[Setting Up PxPlus Web Server](https://manual.pvxplus.com/web-server-reference/setting-up-pxplus-web-server/introduction)**
