Phorm™ v3.5.2
Copyright © 2005 Holotech Enterprises.
File Locations:
If your configuration file and template and other files are not in the same directory as
Phorm itself, Phorm needs to know where they are. Use the variable $PHORM_NAME to give your form a name and specify file locations.
$PHORM_NAME
To use this feature, make up a unique name for your form, and create a HIDDEN
field in your form named PHORM_NAME, with this name as the value. If $PHORM_NAME is set when Phorm starts up, Phorm looks for a file named
phormbase.php. This file contains a list of form names and
corresponding file paths. Phorm performs a lookup in this file, based on $PHORM_NAME, and changes to the corresponding directory after phormconfig.php has been processed. Here is a sample phormbase.php file, showing the format:
Order 1: /usr/www/users/myid/order1/
CustData: configfiles
The path may be absolute, or relative to Phorm's directory. If
$PHORM_NAME contained "Order 1" in the above case, Phorm would
look in the directory /usr/www/users/myid/order1/
for the form-specific configuration file (defined in
$PHORM_CONFIG); for the "CustData" example it would look in the directory configfiles under your Phorm directory. If phormbase.php does not exist or does not contain a match for $PHORM_NAME, no directory change occurs. On Pair Networks servers (where
Phorm was born and raised), the absolute path to your
public_html directory is /usr/www/users/username,
where username is the name you log in with.
Other Directories
If you wish to have your templates and other files in a different directory from the
form-specific config file, set $PHORM_BASE in the config file.
It should simply contain a path for Phorm to switch to, and not a form name for lookup;
again, the path may be either absolute or relative to the directory Phorm is in.
The directory specified in the phormbase.php file or in the
$PHORM_BASE variable can optionally have three subdirectories:
templates, attachments and
uploads. If templates exists,
Phorm will look for template files there; if attachments
exists, Phorm will look for attachment files there; if uploads
exists, uploaded files will be stored there.
Examples
If this is a bit confusing, take a look at how the example forms are set up.
For the "widgets" form, the config file is examples/widget.
Its template and rules files are in
examples/widget/templates, and files for attaching to the autoresponder are in
examples/widget/attachments. The PHORM_NAME
field in the HTML form causes Phorm to look up WidgetInquiry in
the file phormbase.php, which instructs it to change to the
examples/widgets directory.
The "warbles" form is set up essentially the same way, with the addition of an uploads
directory at examples/warbles/uploads. The
PHORM_NAME field in the HTML form causes Phorm to look up WarbleSpec in the file phormbase.php,
which instructs it to change to the examples/warble
directory.
$PHORM_ROOT
If you don't specify absolute directories, Phorm looks for files and directories under the
directory it's installed in. You can alter this if you are able to set environment
variables for your server. Phorm looks for a file path in the environment variable
PHORM_ROOT when it starts. If it is set, relative file paths will start there
instead.
The rationale behind this whole operation is, again, to make it more difficult for someone
else to abuse your installation of Phorm. If Phorm didn't strip path information from the
$PHORM_CONFIG variable, someone on the same server as you could
set up a configuration file of their own, set $PHORM_CONFIG to
point to it, and call your installation of Phorm and use it to send out messages. Since
phormbase.php is a local file, your Phorm installation is
secure so long as your account is secure.
0101000001101000011011110111001001101101010010010111001101000011011011110110111101101100