WWW Interface Tool is at -
Old name is Professional Home Pages (PHP 3) and new name is PHP Hypertext Pre-Processor
Questions e-mail to :
PHP 3 is a server-side html-embedded scripting language. It lets you write simple scripts right in your .HTML files much like JavaScript does, except, unlike JavaScript PHP 3 is not browser-dependant. JavaScript is a client-side html-embedded language while PHP 3 is a server-side language. PHP 3 is similar in concept to Netscape's LiveWire Pro product. If you have the money, you run Netscape's Commerce Server and you run one of the supported operating systems, you should probably have a look at LiveWire Pro. If you like free fast-moving software that comes with full source code you will probably like PHP 3.Standard CGI, FastCGI and Apache module Support As a standard CGI program, PHP 3 can be installed on any Unix machine running any Unix web server. With support for the new FastCGI standard, PHP 3 can take advantage of the speed improvements gained through this mechanism. As an Apache module, PHP 3 becomes an extremely powerful and lightning fast alternative to CGI programmimg.
* Large parts of this code were developed at and for the University of Toronto. Many thanks to Lee Oattes of the Network Development Department at the university for constant constructive criticism.
* The PostgreSQL support code was written by Adam Sussman
* Countless others have helped test and debug the package.
PHP began life as a simple little cgi wrapper written in Perl. It was never intended to go beyond own private use. The name of this first package was Personal Home Page Tools, which later became Personal Home Page Construction Kit.
A tool was written to easily embed SQL queries into web pages. It was basically another CGI wrapper that parsed SQL queries and made it easy to create forms and tables based on these queries. This tool was named FI (Form Interpreter).
PHP/FI version 2.0 is a complete rewrite of these two packages combined into a single program. It has now evolved to the point where it is a simple programming language embedded inside HTML files. The original acronym, PHP, has stuck. It isn't really appropriate any longer. PHP/FI is used more for entire web sites today than for small Personal Home Page setups. By whatever name, it eliminates the need for numerous small Perl cgi programs by allowing you to place simple scripts directly in your HTML files. This speeds up the overall performance of your web pages since the overhead of forking Perl several times has been eliminated. It also makes it easier to manage large web sites by placing all components of a web page in a single html file. By including support for various databases, it also makes it trivial to develop database enabled web pages. Many people find the embedded nature much easier to deal with than trying to create separate HTML and CGI files.
Throughout this documentation any references to PHP, FI or PHP/FI all refer to the same thing. The difference between PHP and FI is only a conceptual one. Both are built from the same source distribution. Now PHP/FI is renamed as PHP 3.
The first thing you will notice if you run a page through PHP/FI is that it adds a footer with information about the number of times your page has been accessed (if you have compiled access logging into the binary). This is just a very small part of what PHP/FI can do for you. It serves another very important role as a form interpreter cgi, hence the FI part of the name. For example, if you create a form on one of your web pages, you need something to process the information on that form. Even if you just want to pass the information to another web page, you will have to have a cgi program do this for you. PHP/FI makes it extremely easy to take form data and do things with it.
Suppose you have a form:
<FORM ACTION="/cgi-bin/php.cgi/~userid/display.html" METHOD=POST>
<INPUT TYPE="text" name="name">
<INPUT TYPE="text" name="age">
<INPUT TYPE="submit">
<FORM>
Your display.html file could then contain something like:
< ?echo "Hi $ name, you are $ age years old!<p>" >
It's that simple! PHP/FI automatically creates a variable for each form
input field in your form. You can then use these variables in the ACTION
URL file.
The next step once you have figured out how to use variables is to start playing with some logical flow tags in your pages. For example, if you wanted to display different messages based on something the user inputs, you would use if/else logic. In our above example, we can display different things based on the age the user entered by changing our display.html to:
<?
if($age>50);
echo "Hi $name, you are ancient!<p>";
elseif($age>30);
echo "Hi $name, you are very old!<p>";
else;
echo "Hi $name.";
endif;
>
PHP/FI provides a very powerful scripting language which will do much more
than what the above simple example demonstrates. See the section on the
PHP/FI Script Language for more information.
You can also use PHP/FI to configure who is allowed to access your pages. This is done using a built-in configuration screen. With this you could for example specify that only people from certain domains would be allowed to see your pages, or you could create a rule which would password protect certain pages. See the Access Control section for more details.
PHP/FI is also capable of receiving file uploads from any RFC-1867 compliant web browser. This feature lets people upload both text and binary files. With PHP/FI's access control and logical functions, you have full control over who is allowed to upload and what is to be done with the file once it has been uploaded. See the File Upload section for more details.
PHP/FI has support for the PostgreSQL database package. It supports embedded SQL queries in your .HTML files. See the section on PostgreSQL Support for more information.
PHP/FI also has support for the mysql database package. It supports embedded SQL queries in your .HTML files. See the section on mysql Support for more information.
A good way to run PHP/FI is by using a cgi redirection module with the Apache server. Please note that you do not need to worry about redirection modules if you are using the Apache module version of PHP/FI. There are two of these redirection modules available. One is developed by Dave Andersen
and it is available at and the other comes bundled with Apache and is called mod_actions.c. The modules are extremely similar. They differ slightly in their usage. Both have been tested and both work with PHP/FI.Check the Apache documentation on how to add a module. Generally you add the module name to a file called Configuration. The line to be added if you want to use the mod_actions module is:
Module action_module mod_actions.o
If you are using the mod_cgi_redirect.c module add this line:
Module cgi_redirect_module mod_cgi_redirect.o
Then compile your httpd and install it. To configure the cgi redirection you need to either create a new mime type in your mime.types file or you can use the AddType command in your srm.conf file to add the mime type. The mime type to be added should be something like this:
application/x-httpd-php phtml
If you are using the mod_actions.c module you need to add the
following line to your srm.conf file:
Action application/x-httpd-php /cgi-bin/php.cgi
If you are using mod_cgi_redirect.c you should add this line to
srm.conf:
CgiRedirect application/x-httpd-php /cgi-bin/php.cgi
Don't try to use both mod_actions.c and mod_cgi_redirect.c at the same
time.
Once you have one of these cgi redirection modules installed and configured correctly, you will be able to specify that you want a file parsed by php/fi simply by making the file's extension .phtml. Furthermore, if you add index.phtml to your DirectoryIndex configuration line in your srm.conf file then the top-level page in a directory will be automatically parsed by php if your index file is called index.phtml.
You can automatically redirect requests for files with a given extension to be handled by PHP/FI by using the Netscape Server CGI Redirection module. This module is available in the File Archives on the PHP/FI Home Page. The README in the package explicitly explains how to configure it for use with PHP/FI.
NCSA does not currently support modules, so in order to do cgi redirection with this server you need to modify your server source code. A patch to do this with NCSA 1.5 is available in the PHP/FI file archives.
If you build the CGI version of PHP/FI, you can use it from the command line simply typing: php.cgi filename where filename is the file you want to parse. You can also create standalone PHP/FI scripts by making the first line of your script look something like:
#!/usr/local/bin/php.cgi -q
The "-q" suppresses the printing of the HTTP headers. You can leave off
this option if you like.