Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
186 views

Tutorial PHP Maker

PHPMaker 5 is a major upgrade from previous versions that provides many new features and enhancements. It includes improved list, view, and form pages with features like grid editing, inline adding/copying, and confirmation steps. It also offers enhanced security, dynamic selection lists, multiple master/detail relationships, and more customization options.

Uploaded by

Deddy Erwin J
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
186 views

Tutorial PHP Maker

PHPMaker 5 is a major upgrade from previous versions that provides many new features and enhancements. It includes improved list, view, and form pages with features like grid editing, inline adding/copying, and confirmation steps. It also offers enhanced security, dynamic selection lists, multiple master/detail relationships, and more customization options.

Uploaded by

Deddy Erwin J
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 68

See What's New in PHPMaker 5

Features: (Click the links to view further details and screenshots)

 All scripts linked up properly

 Optional PHP list, add/copy, view, edit, delete, multi-update and search pages for each
table/view. (See Table Setup) Customizable table display order.
 Optional Inline-Add, Inline-Copy, Inline-Delete, Inline-Edit right in the List page
 Optional confirmation page before insering or updating record
 Pagers in List/View page
 Fully customizable View and Edit format for each field. (See Field Setup) Customizable field
display order.
 Client-side JavaScript validation
 Optional search features (Quick, ExtendedQuick and Advanced) with search result highlight
 Optional User ID and User Level Advanced Security to protect data from unauthorized access.
(See Security Settings) Supports Parent User ID and Dynamic User Levels.
 Complete user registration system with optional user activation
 Optional HTML settings. Charset, font, CSS, HTML colors, HTML table settings with preview.
(See HTML Settings)
 Multiple Master/Detail pages
 Various PHP options. Charset, locale, default date formats, etc . (See PHP Settings)
 Saving and restoring project from Project File
 Synchronize project settings with changes in database.
 Creates virtual directory in IIS automatically
 CSS stylesheet integration
 Field aggregation (sum, average and count)
 Custom View with built-in visual query builder
 Basic reporting
 Export to HTML/Word/Excel/CSV/XML from List/View page
 Multi-column sorting
 User selectable page size
 Table-specific List page options
 File uploading to folder and database
 Dynamic table loading
 Composite key
 Highlight and select row color
 Auto-Suggest and Auto-Fill textbox
 Adding option to Selection List dynamically
 Dynamic Selection List with multiple selection support
 Auto-login and Auto-Redirect
 Multi-page update
 Audit Trail
 Email Notification on Add/Edit/Delete
 Optional CAPTCHA system
 File uploading to folder and database
 Dynamic table loading
 Server events and client scripts
 Code repository
 Fully customizable template and extensions

What's New in PHPMaker 5

PHPMaker 5 is a major upgrade from 4.x. It is loaded with a bunch of new features, including many
frequently requested ones. The template has been largely rewritten to provide better code and better
features. PHPMaker has become even more powerful and flexible, and yet still easy-to-use as always.

Enhanced List Page - Grid-Edit, Inline-Add, Inline-Copy and Search Result Highlight

PHPMaker 5 offers Grid-Edit feature, now you can edit multiple records simultaneously in the List
page. Moreover, complementing the existing Inline-Edit and Inline-Delete features, PHPMaker 5 offers
Inline-Add and Inline-Copy as well, now you can modify (Add/Copy/Edit/Delete) records right in the
List page. Search result can also be optionally highlighted.

Grid-Edit

Inline-Add/Copy
Search Result Highlight

Multi-Update Page

With the existing Multi-Delete feature you can select multiple records in the List page and delete them
all. With new Multi-Update feature you can select multiple records in the List page and update selected
fields to the same data in one go.

Enhanced View Page - Pager and Export

The export feature of the List page is extended to the View page for user to export a single record.
Paging (one record per page) is also supported in View page for users to navigate through the records
without going back to the List page.
Enhanced Add/Edit/Registration Page - Data Confirmation

In some cases you may want to let users to check their input before actually inserting or updating a
record. PHPMaker 5 lets you optionally add a confirmation step for Add, Edit or Registration pages. If
the form involves image upload, the user will also be able to view the uploaded image during
confirmation.

CAPTCHA

PHPMaker 5 supports CAPTCHA (template extension) for Add pages and Registration page.
CAPTCHA requires that the user type the letters or digits of a distorted image before submitting a form
to prevent automated software from posting spam to your PHP application.
Multiple Master/Detail

In previous version mulitple detail tables were allowed for a table but multiple master tables were not
directly supported. PHPMaker 5 offers built-in support for Multiple Master/Detail. Each table can have
multiple detail tables and multiple master tables. A visual master/detail setup interface is also provided
for easy setup and modification.
More Ajax

PHPMaker 4 first introduced Ajax features. PHPMaker 5 gives you more:

Detail Records Preveiw


Ever wanted to view the detail records without going to the detail table? This new feature (template
extension) gets the detail records of a master record by Ajax and display them in a overlay panel when
the user move the mouse cursor over the detail table links in the master table.
Enhanced Dynamic Selection List with Multiple Selection Support
Ajax Dynamic Selection List has been limited to comboboxes (one selection) in previous version, now
it supports listboxes (multiple selection) also.

Auto-Fill
Similar to updating a child combobox in Dynamic Selection List, this Auto-Fill feature automatically
fill a child textbox by Ajax when an option of the parent combobox is selected. You can update
multiple child textboxes just like updating multiple child selection lists in Dynamic Selection List
feature.

Add Extra Option to Dynamic Selection List


Since v5 you can add an extra option to a selection list with lookup table on the fly, but it did not fully
support Dynamic Selection List with parent field, PHPMaker 5 has extended the feature and enabled
you to add extra parent/child options to Dynamic Selection Lists as well.

Improved Advanced Security

Anonymous User
In previous verions, anonymous access is provided by User Level Security's built-in Anonymous User
Level. In PHPMaker 5, the new Anonymous User can work independently or together with User ID
Security and/or User Level Security. When enabled for a table, users will be able to see all records of
the table in the List page before and after login, but only able to modify their own records (and
optionally their child users' records) after login.
Auto-Redirect
In previous verions, users will be redirected to the default page after login. In PHPMaker 5, users will
be redirected to the page they originally access.

Registration Confirmation Email to New User and Activation Option


In previous verions, email notification about new user registration will only be send to the preset
recipient, now you can optionally send to the new user and request the new user to click a link to
activate the new account.

Server Events and Client Scripts

If you customize templates, this new feature enables you to save your own code, both server-sider and
client-side, in your project. This feature reduces template customization so you can migrate your
project to other templates more easily. The View Tag (for display) and Edit Tag (for input) of the fields
now supports Custom Attributes so you can add your own attributes to work with your own code. The
server events and client scripts provide advanced users a lot of possibilities for project customization,
for example, you can use the Row_Rendered() event to do conditional formatting of a field.
Furthermore, PHPMaker 5 provides a Code Repository for easy reuse of your code across projects and
sharing with other users.

Auto-Update Fields

This feature makes it easy to auto-update a field, you just need to choose an auto-update value, such as
current date, current user IP, current user name. You can even add you own. It is no longer necessary to
set up default value in the Add page and custom hidden value in Edit page for these fields.

More

 Login/Logout audit trail


 More HTML settings for modifying the general look and feel
 Duplicate value checking in Edit page also
 Date/Time formats with time part
 Custom validation functions allowed
 Option to display no records in List page before searching
 Paging section at top and/or bottom
 Collapsible Quick/Extended Search panel (template extension)
 Project auto-backup
 Object Oriented Programming (OOP)
 Many other minor enhancements
Table Setup

After loading the database, the tables and views will be shown in the database pane on the left pane
(database pane). Click on the [Tables] or [Views] or [Custom Views] or [Reports] node to go to the
Table Setup page at any time.

Note: For simplicity, we use "table" in the following description to refer to any of database object in
the project. A database object can be either a table, a view, a custom view or a report.

The Table Setup pages consists of two section. The upper section is a grid showing available options of
all tables. The lower section contain two panels, the [Table-specific Options] panel and the
[Master/Detail] panel for the selected table.
Notes:

1. For all checkbox or combobox columns, if you want to apply the setting to ALL tables or
views, you can choose your setting at the [Tables] or [Views] or [Custom Views] or [Reports]
row.
2. View/Edit/Search functionality works at field level and can be setup for each field in the Field
Level Setup page. Please refer to the Field Setup for details. If all fields are not selected for
View/Edit/Search, the function will not be generated.

You can change the display order of the menu item by drag-and-drop. Select a table by clicking the
first column - [Table/View Name] column, then drag and drop to where you want. Note that a table
cannot be moved out of its parent node.

IMPORTANT NOTES:

1. It is assumed that all tables have primary key. (Composite key is supported) If there is no
primary key specified, View/Add/Copy/Delete/Edit/Update settings have no effect and will be
reset to disabled when the [Generate] button is pressed. Only the List page can be generated. If
you add back a primary key later, you'll need to come back to this page and re-enable them.
Since reports are read-only, View/Add/Copy/Delete/Edit/Update settings are not applicable to
reports.
2. Views or Custom Views involving more than one table are usually NOT updatable. Although
you can force PHPMaker to enable the Add/Copy/Delete/Edit/Update pages by specifying a
primary key, the generated pages will not work if these views or Custom Views cannot be
updated like regular tables.

The available table level settings are as follows:

General

Generate Select/unselect a particular table for generation


Caption To change the caption of a table, click on [Caption] box to make the necessary
change.

Note: Avoid special characters, you can use HTML entities instead. See Project
File for more details.
Filter Specify a filter (WHERE clause) for the table. Click the [...] button in [Filter]
column, the Filter Editor will popup. Enter your filter, you can drag the field
names from the left pane to the editor, the SQL identifier quote characters will also
be added for you automatically.

Note: The filter must be a valid PHP string as the WHERE clause will be
concatenated to the SQL string. For example, "State = 'CA'".
Sort Specify the sort fields (ORDER BY clause) for the table. Click the [...] button in
[Sort] column, the following dialog box will popup. You can choose up to 6
fields, in either ascending or descending order.
Default Set a Table as the Default Table. The Default table is the first table the user see
when visiting your site. Select the table you want in the [Default] column.
Menu Uncheck the table in the [Menu Item] column if you don't want to show the table
Item in the navigation menu generated by PHPMaker.

List
Settings for List pages:

Inline Add
Enable/disable Inline Add function for the table. Inline Add
allows users to add a record within the List page. Default is
disabled.
Inline Copy Enable/disable Inline Copy function for the table. Inline Copy
allows users to copy a record within the List page. Default is
disabled.
Inline Edit Enable/disable Inline Edit function for the table. Inline Edit
allows users to edit a record within the List page. Default is
disabled.
Grid-Edit
Enable/disable Grid-Edit function for table. Grid-Edit allows
users to edit multiple records within the List page. Default is
disabled.
Requires Search Specifies if the List page requires search criteria. Default is
Critera disabled.
Notes:

1. If enabled, the List page always requires search criteria.


When the page is initially loaded, no records will be
displayed until searching is done. (Remember to enable
Quick Search, including Extended Quick Search, or
Advanced Search or both. See below.)

2. If a record is added but the new record does not meet


the search criteria (or there is no search criteria yet), the
record will not appear in the List page. So this option is
best for tables which are for browsing only.

View

View If enabled, a View page for the table will be generated (for displaying a record).
Default is enabled.

Note: The table must have primary key or this setting will be unchecked during
generation.

Add
Settings for Add pages:

Add If enabled, an Add page for the table will be generated (for adding/copying a
record). Default is enabled.

Note: The table must have primary key or this setting will be unchecked
during generation.
Copy If enabled, Add page will be generated and "Copy" links will be generated
for record(s) in List/View page (for copying). Default is enabled. (If this
setting is enabled, the "Add" setting is also enabled by default as copying
requires the Add page.)

Note: The table must have primary key or this setting will be unchecked
during generation.
CAPTCH Enable/disable CAPTCHA function for the Add page. Default is disabled.
A (CAPTCHA requires that the user type the letters or digits of a distorted
image before submitting a form to prevent automated software from posting
spam to your PHP application.)

Notes:

1. CAPTCHA function requires CAPTCHA extension, click Tools-


>Extensions from the main menu to enable. Also see Third-party
Tools.

2. CAPTCHA function is not applicable to Inline-Add/Copy.


Confirm Enable/disable confirmation function for the Add page. Default is disabled.
If enabled, there will be a confirmation step in the Add page, users will be
able check their input before actually inserting the record.

Note: Confirmation function is not applicable to Inline-Add/Copy.

Edit

Edit If enabled, an Edit page for the table will be generated (for updating a record).
Default is enabled.
Note: The table must have primary key or this setting will be unchecked during
generation.
Confir Enable/disable confirmation function for the Edit page. Default is disabled. If
m enabled, there will be a confirmation step in the Edit page, users will be able
check their input before actually updating the record.

Note: Confirmation function is not applicable to Inline-Edit.

Delete

Delete If enabled, a Delete page for the table will be generated (for deleting record or
multiple records). Default is enabled.

Note: The table must have primary key or this setting will be unchecked during
generation.

Multi-Update
PHPMaker 5 supports Multi-Update.

Multi- If enabled, a Multi-Update page for the table will be generated (for
Update updating multiple records). Default is disabled. With this feature you can
select multiple records in the List page and update all records at the same
time. You can select fields (see Field Setup page) to be included in the
Multi-Update page.

Note: The table must have primary key or this setting will be unchecked
during generation.
Confirm Enable/disable confirmation function for the Multi-Update page. Default is
disabled. If enabled, there will be a confirmation step in the Multi-Update
page, users will be able check their input before actually updating the
selected records.

Search

Quick If enabled, Quick Search panel (including Extended Quick Search) will be
generated with the List page. Default is enabled.

Note: Quick Search searches text fields and optionally numeric fields only.
These fields are selectable in Field Setup page. You may want to hide the
Quick Search form for tables that do not have searchable fields.
Advance If enabled, an Advanced Search Page will be generated and linked to the List
d page. Default is disabled.
Highlight If this setting is checked, the search criteria in the search result (List page) will
be highlighted. Default is disabled.

Note: The highlight style can be modified by customizing the CSS stylesheet.

Audit Trail
PHPMaker supports audit trail.

Audit
Trail If audit trail for a table is enabled, when an user add/copy/edit/delete a record
or login/logout, the related information will be logged in a log file. To use
this feature, you must also specify the [Audit Trail folder] under [PHP]-
>[General Options] tab. See PHP Setup for details.

Email Notification
PHPMaker supports sending notification emails. To use this feature, you must also specify the [Email
Settings] under [PHP]->[Email Settings] tab. See PHP Setup for details.

On Add
If enabled, when an user add a record, an email will be send to pre-set
recipient email address(es). Default is disabled.
On Edit
If enabled, when an user edit a record, an email will be send to pre-set
recipient email address(es). Default is disabled.
On
Delete If enabled, when an user delete a record, an email will be send to pre-set
recipient email address(es). Default is disabled.

Table-specific Options
There otpions are same as the list page options as described in PHP Setup except that the options are
table-specific, meaning that you can have different list page options for different tables. To use table-
specific options, select a table in the grid, uncheck [Use global settings] in the [Table-specific
Options] panel, the panel will be enabled for you to setup.

Multiple Master/Detail
When you set up a master/detail relationship, you link two tables so that all the records of one table (the
detail table) always correspond to the single current record in the other table (the master table).
PHPMaker (5+) supports multiple master/detail, which means that each table can have multiple master
tables and details tables.

You can establish master/detail (one-to-many) relationship between two tables as follows

1. Select a table in the table grid,


2. Then in [Master/Detail] panel at the bottom right corner of the page, click [Modify...] to bring
up the visual master/detail relationship editor.
3. Click [Add table] to add the master and detail table to the diagram.
4. Create a relationship between them by dragging from the master field (key field in master
table) to the detail field (foreign key field in the detail table). If there are more linked field,
repeat the step until all the relationships are setup.

If you want to remove a relationship, select the link in the diagram and click [Delete]. After setup, click
[OK] to confirm.

Note: The diagram only shows master/detail relationships of the selected table. Although you can setup
relationships for other tables in the diagram and view them in the [Master/Detail] panel immediately
after clicking [OK], the relationships for other tables will not be loaded again if you go to other table
and then come back to this table. Instead, the relationships will only be displayed when you change to
the related tables.

In most cases, master and detail tables are joined by one field, you have one link between the
master/detail table and you have one row in the Master/Detail panel only.
If you want to use Detail Record Preview feature, click Tools->Extensions to enable to YUI
Container extension (for registered users only).

Note: The Detail Record Preview feature is not applicable to reports (as detail table) and aggregate
values (if any) for the detail records are currently not supported in the preview.

Also See:

Tutorial - Master/Detail

Tutorial - Master/Detail

In this tutorial we will show you how to setup Master/Detail table view in PHPMaker. We will use the
demo database for demonstration.

In the demo, there are two tables called "Orders" and "Order Details". We will set up the master/detail
relation between these two tables.

Fields in Table "Orders"


Fields in Table "Order Details"

Steps to Setup Master/Detail Records

1. Loading PHPMaker

Open PHPMaker and connect to the demo database.

2. Setting up Master/Detail Relationship

Click [Tables] (or any child node of the database node) on the Database tree view in the left pane. The
Table Setup page is displayed in the right pane.
To setup the Master/Detail relation between table "Orders" (Master) and "Order Details", select either
table, in this example, we choose "Orders" table at Table/View list. Then in [Master/Detail] panel at
the bottom right corner of the page, click [Modify...] to bring up the visual master/detail relationship
editor. Drag the detail table from the table list on the left to the diagram on the right.
Then create a relationship between them by dragging from the master field (key field in master table) to
the detail field (foreign key field in the detail table).
If there are more linked field, repeat the step until all the relationships are setup. In this tutorial, we
only have one detail field ([Order Details].[OrderID]) and one master field ([Orders].[OrderID]).

PHPMaker 5+ supports multiple master/detail, if the table has other master tables or detail tables, just
repeat above process. In this example, we have only one master/detail relationship, so we click [OK] to
confirm. The master/setail relationship is setup.

If you have the YUI Container extension (for registered users only) and want to enable Detail Record
Preview by Ajax, you can click Tools->Extension to enable it. Also see Third-Party Tools.

Note: The Detail Record Preview feature works best when the number of the fields and number of
records are not too many so the size of the preview area will not be too large. Otherwise the preview
area may exceed the browser area and therefore the detail records cannot be viewed completely at a
glance. Or the preview area will be too wide that it covers the detail table link and therefore the
preview area can be hidden by moving the mouse cursor from the link.
3. PHP Script Generation

Click the [Generate PHP] icon to go to the [Generate] tab, click the [Generate] button. PHPMaker
will generate the required PHP scripts automatically.

4. Running the PHP Application

Click on the link to the "Orders" table, there will be a new column of "Order Details Details" which
links to the "Order Details " table. Click on the link to access the Order Details for that Order.

If you have enabled YUI Container extension, move your mouse cursor over the "Order Details..."
link and you'll see detail records preview:
Click the "Order Details..." link, the Detail Record List Page for "Order Details" will be shown as
below. To add, delete, view, edit or search records in the Detail table, simply click on the
corresponding links in the page.
Field Setup

After loading the database, the database objects (tables, views, custom views and reports) will be
shown in the left pane (the database pane). Click on any table to go to the Field Setup Page for that
table at any time.

Note: For simplicity, we use "table" in the following description to refer to any of database object in
the project. A database object can be either a table, a view, a custom view or a report.

PHPMaker support all commonly used ADO data type. If PHPMaker finds any unsupported fields in a
table, an [Unsupported Fields] tab will appear. You can click on the tab to view the list of fields that
are not supported.

The Field Setup pages consists of two section. The upper section is a grid showing available options of
all fields. The lower section contain two panels, the [Edit tag] panel and the [View tag] panel for the
selected field.

The grid consists of the following sections:

 General
 List Page
 View Page
 Edit Page
 Add Page
 Multi-Update Page
 Advanced Search Page
General

Properties

Field Name Field Name (read only)


Data Type Data Type (read only)
Size Maximum field length (read only)
Caption Caption to be displayed
Primary Key Primary Key of the table

Important Note:
1. You should never change this field unless you are absolutely
sure that this field is unique. Otherwise a particular record
cannot be located and unexpected results may occur.

2. Composite key is supported, and primary key is uneditable in


the edit page.
Page No. Page number of the field. By default all the fields are in page 1 and
multi-page is disabled.

Multi-page Add/Edit is supported. If you set any page number to larger


than 1, multi-page feature will be enabled automatically.
Auto-Update A dynamic value to update the field function automatically in Add/Edit
Value pages.

The dropdown list for this setting is preloaded with a few functions for
your selection. For exmaple, you may want to record the last modified
date of a record, then you can select "ew_CurrentDate". Do not select a
function that return values of unmatching data type, for example, you
should not select a function that return a non-numeric string for a
numeric field.

Notes:

1. This setting will make the field hidden automatically and it


overrides the default value in Add page and custom value for
Hidden Edit tag in Edit page. (see section below)

2. You can add your own PHP functions, the function must accept
no argument and return a value. You can add your function
names (comma separated) in the following registry key:

HKEY_CURRENT_USER\Software\PHPMaker\<Version>\
Settings\General
Value: AutoUpdateValues

e.g. You can enter


"MyAutoValueFunction1,MyAutoValueFunction2". Of course,
you also need to include your PHP functions in the generated
scripts or in the template so it is available for use.

Custom field display order by drag-and-drop

You can change the field order defined in the database by simple drag-and-drop. Simply click the Field
Name column to select the field, then drag it to where you want. PHPMaker will generate PHP and
display records according to this order.

List Page

Properties

List Show field in list page


Aggregate Enable Field Aggregation. Aggregated values will be shown at Page
Footer. Not applicable in multi-column view. Aggregate options include:
- TOTAL (sum of all field values in current page)
- COUNT (count of records in current page)
- AVERAGE (average field value in current page)
Width Specify field column width
e.g. If you enter "200px" (without quotes), the output will be style="width:
200px"
Wrap Enable/Disable wrapping of field value
Quick Include this field when performing Quick(Basic) Search in the List page.
Search Note: Only text fields and numeric fields are supported in Quick Search.
By default only text fields are enabled.
Ext. Search Use this field in Extended Quick Search

Extended Quick Search is enhancement of Quick Search. It is sort of a


combination of Quick Search and Advanced Search. If a field is checked
for Ext. Search, a form element for the field will be shown in the
Quick(Basic) Search form and the user input criteria for this field will be
included when performing Quick(Basic) Search.

Extended Quick Search will use the same search operators specified under
the "Advanced Search Page" section (see below).

View Page

Properties

View Show field in view page


View Tag HTML tag to display the field. Used in List/View pages.

You can either click the [View Tag] column and select a View Tag from the drop down box or click
the icon on the View Tag panel toolbar to select. After selecting the View Tag, you can further setup its
properties in the View tag panel.
There are two types of View tag, Formatted Text and Image.

Formatted Text - View Tag to display the field value as formatted text using <div> tag with optional
hyperlink. Properties:

Format
None No formatting
Currency Display in currency format
Date/Time Display in date format
Number Display in number format
Percent Display in percent format
String Format the field value with specified VBScript string function
or custom function
Max Length (List Truncate the field value at specified max. length and append
page) "..." to the end.
Note: This setting only applied to memo fields in list page and
must be larger than 0 to take effect.
DIV Tag attributes
Style Bold - Display as Bold
Italic - Display as Italic
Align - Left/Center/Right/Justify. Align the data.
Custom Attributes Other custom attributes for the <div> tag. For example, you can
enter "onmouseover='myjsfunction();'".
Hyperlink
HREF field Display the field as hyperlink with the href attribute set to the
value of this field. Can be the field itself.
Target _top/_parent/_self/_blank
Prefix - None (no prefix, relative path of url)
- http:// (prefix http:// added, absolute path of url)
- mailto: (prefix mailto: added, email link)
- ftp:// (prefix ftp:// added, ftp link)
- file:// (prefix file:// added, file link)
- news:// (prefix news:// added, newsgroup link)
Suffix Append the input string to the URL

Image - View Tag to display as Image using <img> tag. The field should be a BLOB field or a field
storing the path of the image.

IMG Tag attributes


Width Specify the width of the image
Height Specify the height of the image
Alt Specify the alt attribute of the image tag
Custom Other custom attributes for the <div> tag. For example, you can enter
Attributes "onmouseover='myjsfunction();'".
Resize Resize the image to above width and/or height on displaying the
image.
Note: Note that this feature requires Image Resize extension and
supports GIF, JPEG and PNG images only, click Tools->Extensions
from the main menu to enable. The extension requires GD2 library,
update your PHP version to the latest version and enable the GD2
library if necessary. See Third-Party Tools.
Hyperlink (same as above)

Edit Page
Properties

Edit Show field in edit page


Title Title to be placed in title attribute of Edit Tag. (see section below)
Read
Make the field read only in edit page
Only
Edit Tag Form element for the field. Use in Add/Copy/Edit/Search pages. (See below
for details)

You can either click the [Edit Tag] column and select a Edit Tag from the drop down box or click the
icon on the [Edit Tag] panel toolbar to select. After selecting the Edit Tag, you can further setup its
properties in the Edit Tag panel:

Edit Tags

Edit Tags are HTML forms elements for the field in Add/Copy/Edit/Search pages. All HTML form
elements are supported:

Text <input type="text"> tag

Display the field as a textbox.

Size - size of the textbox

MaxLength - maximum input length


of the textbox

Custom attributes - Other custom


attributes for the tag

Validation - see section below

Use Lookup Table - enable Auto-


Suggest and/or Auto-Fill feature by
Ajax.

Auto-Suggest - With a lookup table,


when the user type in the textbox, a
dynamic dropdown list populated with
data from the lookup table matching
the user input will appear for user to
select. If the data already exists, the
user can easily select without typing
the full text. If not, the user can still
input as usual. To enable this feature,
check [Use Lookup Table] and enter
the lookup table info in the [Lookup
Table] panel next to the [Edit Tag]
panel. (See section below)

Auto-Fill - This is an extended version


of Auto-Suggest, in which the Ajax
script does not only "auto-suggest", it
actually fill in the field for your
automatically. For example, when you
select a product number, it will fill in
the product name and product price
textbox for you. The required
conditions are:

1. the current field has a


[Parent field] in the
lookup table settings
2. the parent field is setup
as a combobox (That is,
one selection only, or in
other words, the parent
field uses Select Edit tag
with [Multiple] option
DISABLED, see
description for Select
Edit tag below.)
3. the parent field uses the
same lookup table as the
current field

If these conditions are met, when the


user changes the parent combobox, the
Ajax script will try to lookup another
field value (specified by [Display field
#1] of the lookup table for the current
field) from the record found according
to the selected option of the combobox,
and the value will be filled into the
textbox automatically.

For instance, when you select a product


number from combobox, the script
know the product ID from the option
value, so it can use the ID to locate the
product from the same lookup table
(your product table) and retrieve
another field value such as product
name or product price and fill the
textbox for the current field.

Note: Before using Auto-Fill, consider


database normalization, in many cases
you do not need to copy the values at
all. You can view the other field values
by creating a query/view joining the
current table with the lookup table
using the parent field as linked field.

Passwor <input type="password"> tag


d
Display the field as a masked textbox.

Size - size of the textbox

MaxLength -= maximum input length


of the textbox

Custom attributes - Other custom


attributes for the tag

Validation - see section below


Radio <input type="radio"> tag

Display the field as an option of a radio


button list. You can enter the options
manually in the [User Value] panel
next to the [Edit Tag] panel.

Custom attributes - Other custom


attributes for the tag

Use lookup table - use an existing


lookup table instead of user input
value/label pairs for the radio buttons.
To enable this feature, check this
option and enter the lookup table info
in the [Lookup Table] panel next to
the [Edit Tag] panel. (See section
below)

Repeat columns - specifies the no. of


radio buttons per row

Validation - see section below


Checkbo <input type="checkbox"> tag
x
Display the field as one or more
option(s) of a checkbox list. You can
enter the options manually in the [User
Value] panel next to the [Edit Tag]
panel.

Note: PHPMaker also consider


enum('Y','N') and enum('1','0') as
boolean fields and display the field by a
checkbox automatically.

Custom attributes - Other custom


attributes for the tag

Use lookup table - use an existing


lookup table instead of user input
value/label pairs for the checkboxes.
To enable this feature, check this
option and enter the lookup table info
in the [Lookup Table] panel next to
the [Edit Tag] panel. (See section
below)

Repeat columns - specifies the no. of


checkboxes per row

Validation - see section below

Note: The submitted values of the


multi-selected checkboxes is a
comma-separated string. Therefore
you must use a string field for
checkbox list.
Select <select> tag

Display the field as a combobox (one


selection) or a listbox (multiple
selection). You can enter the options
manually in the [User Value] panel
next to the [Edit Tag] panel.

Size - no. of options to show. If more


that 1, the selection list is shown as a
listbox, otherwise it is shown as a
combobox.

Multiple: Check to enable multiple


selection (listbox)

Note: The submitted values of the


multi-selected listbox is a comma-
separated string. Therefore you must
use a string field for listbox.

Custom attributes - Other custom


attributes for the tag

Use lookup table - use an existing


lookup table instead of user input
value/label pairs for the checkboxes.
To enable this feature, check this
option and enter the lookup table info
in the [Lookup Table] panel next to
the [Edit Tag] panel. (See section
below)

Use Ajax - specifies if Ajax is used to


update the combobox.

Note: "Use Ajax" option does not


support multiple selection.

Validation - see section below


TextAre <textarea> tag
a
Display the field as a textarea.

Cols - no. of columns of the textarea

Rows - no. of rows of the textarea

Custom attributes - Other custom


attributes for the tag

Use DHTML Editor - replace the


textarea with a DHTML editor for
editing the data as HTML.

Note: The DHTML Editor(s) requires


newer version of browsers such as
IE6+, NS7+ or FF1+. It is not
developed by the author of PHPMaker
and no technical support will be
provided. (See Third-party Tools.)

Validation - see section below


File <input type="file"> tag

Display the field as a file upload


control. For BLOB fields or string
fields only.

Size - size of the input tag (NOT file


size)

Custom attributes - Other custom


attributes for the tag

If the field is of BLOB (binary) data


type, file is uploaded to the database.
You can also store the information of
the uploaded file in the following
fields:

File type field - Recommended. Useful


when you want to response to user
browser the exact content type of the
data.

File name field - Optional. Useful if


you want to use the original filename.

Note: Do not specify file name field if


you want IE to open the file
automatically. (IE may fail to open
non-image files retrieved from database
properly.) Use file name field if you
want IE to popup a File Download
dialog for user to save the file with the
filename specified in the file name
field.

File size field - Optional. Stores the


uploaded file size.

Image width field - Optional. For use


with images only. Stores the width of
the uploaded image.

Image height field - Optional. For use


with images only. Stores the height of
the uploaded image.

If the field of string type, file is


uploaded to a subfolder relative to
the application root.

Upload folder - the folder where the


uploaded file will reside. If you do not
enter a specific folder, all the uploaded
files will be put in the global upload
folder specified in the PHP tab (see
PHP Setup).

Notes:

1. Make sure that the Web server


user have read/write access to
the folder. You can right-click
the folder in Windows Explorer
and add read/write access for
IUSR_<MachineName> on the
Security tab.

2. The path is relative to


application root. Use slashes "/"
as path delimiter, no leading
slash. e.g. If the application root
of your website is C:\Inetpub\
wwwroot\demo and you enter
"uploads/folder1" in this
textbox, the folder for the
uploaded files will be C:\
Inetpub\wwwroot\demo\
uploads\folder1. If you are not
sure which folder is application
root, please read Application
Root.

Resize image - Optionally resize the


image to resize width and/or height.

Resize width - the width of the resized


image

Resize height - the height of the


resized image

Note: Note that this feature requires


Image Resize extension and supports
GIF, JPEG and PNG images only, click
Tools->Extensions from the main
menu to enable. The extension requires
GD2 library, update your PHP version
to the latest version and enable the
GD2 library if necessary. See Third-
Party Tools.

Validation - see section below


Hidden <input type="hidden"> tag

Hide the field with a hidden form


element.

Note: This is different from de-


selecting the field in the [Edit] column.
If a field is de-selected, no code will be
generated for the field in the Edit page
and the field will not be updated. With
a hidden form element the field is not
seen but it may still get updated.

Custom value - by default the 'value'


attribute contains the field value,
custom value is used to update the field
with an other value, for example,
"Date()", when a record is updated
using the Edit page.

Custom attributes - Other custom


attributes for the tag

Notes:

1. Custom value is used in Edit


page only. It cannot be used
with Read-only fields, User ID
fields and Detail fields(Foreign
key fields)

2. In Add page, if a default value


is specified (see section below),
hidden form element will also
be used but the 'value' attribute
will contain the default value. If
default value is not specified,
the field will be displayed as a
normal textbox.

Using User Values for Edit Tag (Radio/Checkbox/Select)

For Radio/Checkbox/Select Edit Tags, the default option values are user input values, you can enter as
many value/label pairs as you want in the [User Values] panel next to the [Edit Tag] panel.

Note: For boolean fields, if you use Radio Edit Tag with User Values, the first value/label should be
for True and the second for False.

Using Lookup Table for Edit Tag (Text/Radio/Checkbox/Select)

In real world applications, the option values usually come from a (lookup) table in the database.
PHPMaker make it very simple to use lookup values for key field values, simple click [Use Table], the
[Lookup Table] panel will replace the [User Values] panel, select the following properties:

Table name The lookup table to be linked to


Link field The field to be used as the value of an option (for Radio/Checkbox/Select
only). This field is usually the primary key of the lookup table.
Display field The field in lookup table to be used as the label of an option. (If auto
#1 suggest textbox, only string fields will be selectable.)
Display field Optional. Another field in lookup table to be included in the label of an
#2 option. (If auto suggest textbox, only string fields will be selectable.)
Order By Optional. Used to sort the options.
Asc/Desc Optional. Sorting order.
Distinct Optional. Unique records only. (for Radio/Checkbox/Select only)
Filter WHERE clause to filter options from the table.
Parent field Optional. Available for Select or Text Edit tag only. Specify the parent
selection list for current selection list or textbox. When the parent
selection list is changed, the available options in current selection list or
the value of the current textbox will be changed accordingly.
Note: For used with the Dynamic Selection List and Auto-Fill feature
only. NOT used in Auto-Suggest feature .
Filter Field Optional. Available for Select tag only. When the parent selection list
changes, only records with a Filter Field value matching the selected
value of the parent selection list will be shown.
Note: For used with the Dynamic Selection List feature only. NOT used
in Auto-Suggest or Auto-Fill feature.
Allow Add Optional. If enabled, the user will be allowed to add an option to the
selection list.

Notes:

1. Review your lookup table design before using this option. The
option works best if you there is only one display field and the
link field (primary key) is an autoincrement field. In that case the
user only need to fill in a textbox and the option is added. But if
the link field (primary key) is not an auto-increment field, the
user will need to enter the link field value which the user may not
know.

2. The user will be asked to enter the link field and the display
field(s) only. If the lookup table has other NOT NULL fields
other than the link field and display field(s), the new option
cannot be added. However, you can define default values for
these fields in the database (not in PHPMaker).
3. From PHPMaker 5+, this feature also work with child selection
list Dynamic Selection List. The filter field value also be added
according to the selected option of the parent selection list.

4. This feature is implemented using Ajax, IE6+/NS7+/FF1+ is


required.
Validation (for add/copy/edit/search pages)

The data input for each field can be validated using client-side JavaScript.

Validate Supported validation formats are:


Integer, Float, Range, Date(yyyy/mm/dd), Date(mm/dd/yyyy),
Date(dd/mm/yyyy), Time(hh:mm:ss), Email, Credit card, GUID, US phone
numner, US zip code, US social security number

Notes:

1. Other than "/", the date separator of the validation format can also be "-"
or ".", depending on the default date format setting in PHP Setup page.

2. From PHPMaker 5+, you can add your own JavaScript functions for
validation. The JavaScript function must accept one argument (the
value) and return true (valid value) or false (invalid value). You can add
your function names (comma separated) in the following registry key:

HKEY_CURRENT_USER\Software\PHPMaker\<Version>\Settings\
General
Value: CustomValidationFunctions

e.g. You can enter "myValidateFunction1,myValidateFunction2". Of


course, you also need to include your JavaScript functions in the
generated header or in the template so it is available for use.
Use Check this option to use a visual date picker instead of manual input.
popup
calendar Notes:

1. This option is only available for the date validation formats:


Date(yyyy/mm/dd), Date(mm/dd/yyyy), Date(dd/mm/yyyy).

2. The popup calendar requires IE 5+ or Netscape 7+. It is not developed


by the author of PHPMaker and no technical support will be provided.
(See Third-party Tools.)
Require
Check this checkbox if the field is mandatory
d
Error
Enter the error message to popup if error occurs
Message
Check Specify whether to check duplicated values for the field.
Duplicat
e If the field is an unique indexed field, PHPMaker will generate server side
codes to check duplicate values automatically even this option is not selected.
This option is useful when you want to check a non unique indexed fields for
duplicated values.

Note: In previous version, the validation is done on server side in Add page
only. From PHPMaker 5+, the validation is done on both Add and Edit pages.

Add Page

Properties

Add Show field in add page


Default Default value for field (for adding new record only) . Must be a valid PHP
Value expression. (If it is a string, must be double quoted.)

Multi-Update Page

Properties

Multi- Show field in Multi-Update page


Update Note: If a field is selected, it will be included in the Multi-Update page. In
the generated Multi-Update page, there is a checkbox for each field, the
field will only be updated if the checkbox is checked so users can update
only the checked fields without affecting values of the other unchecked
fields.
Advanced Search Page

Properties

Search Show field in Advanced Search page (Note: NOT related to Quick Search)
Search Opr Search operator #1 for the field. Used in Advanced Search or Extended
1 Quick Search.
Search Opr Search operator #2 for the field. Used in Advanced Search or Extended
2 Quick Search.

Notes:

1. This second search operators will be useful when you may have 2
criteria for the field when searching. You can also select AND/OR
to relate the 2 criteria.
2. PHPMaker supports "BETWEEN" search operator. If you want to
use it, select "BETWEEN" as the first search operator. Since
"BETWEEN" requires 2 search criteria, when it is used, the second
search operator will be ignored.

3. If the first search operator is "USER SELECT" and you want to


allow "BETWEEN" operator, enable the second search operator so
the user can enter 2 search criteria, but again, the second search
operator will be ignored if the user selects the "BETWEEN" as the
first search operator to search. If the second search operator is
disabled, "USER SELECT" does not include "BETWEEN"
operator.
Security Settings

Field Description:
Administrator Login (Hard-
Administrator user id and password
Coded)
Login Name Login Name for administrator
Password Password for adminsitrator
Use Existing Table Link to existing table for login name and
password validation
Table Existing table in database containing login
name and password information
Login Name Field Login Name field in table used for
authentication
Password Field Password field in table used for
authentication

Auto-login

PHPMaker supports auto-login. When you enable the auto-login feature, a few cookies will be placed
on the user's computer to identify the user, meaning that the user do not have to type username and
password every time he/she visit the site. For this reason, you should advise your users not to use this
feature on a public or shared computer, as any other user of the computer will be able to access the
account.

Advanced Security
PHPMaker's Advanced Security feature allows you to setup User ID, assign User Levels to users and
create a complete user registration system. To setup, click the [Advanced] button.

PHPMaker supports two types of security - User ID and User Level. User ID Security secures data at
record level. User Level Security secures data at table level. They complements each other and they
can work independently or together. Users get their User ID and User Level after login. Before login,
their identities are unknown and they are Anonymous Users.

Anonymous User

The permissions for Anonymous users are defined in this form.


Steps to setup Anonyomus User permissions:

1. Click on Anonymous User in the left pane,


2. Define the permissions for each table.

User ID
User ID Security secures data at record level. Protected tables must have an User ID field for
identifying which user a record belongs to. The User ID field names can be different in tables though.
When User ID security is enabled, users can only access their own data.
Steps to setup User ID security for different tables/views:

1. Click on User ID in the left pane.


2. Select the [User ID field] from your user table, this field is usually the primary key of the User
Table. (Note: if this field is not set, the feature is disabled)
3. (Optional) Select the [Parent User ID field] from your user table. Parent User ID field stores
the parent User ID that the user belongs to, parent user can modify the child user's records.
(Note: if this field is not set, the Parent User feature is disabled)
4. In the [User ID Field] column, select the User ID Field for the tables/views that requires User
ID security.

User Level
User Level Security secures data at table level. Each user level is granted with specific permissions to
tables in the database.

There are 2 types of User Level security:

1. Static User Levels - the User Levels and the permissions are defined in this form and the User
Levels are not to be changed after script generation.
Steps to setup static User Level security for different tables/views:

1. Click on User Levels in the left pane,


2. Select an integer field in your user table as the [User Level field], (Note: if this field is not set,
the feature is disabled)
3. Define your user levels, click icon the add an user level and icon to delete an user level.

2. Dynamic User Levels - the User Levels and the permissions are defined in 2 tables in the database,
the User Levels can still be changed with the generated scripts.
Steps to setup static User Level security for different tables/views:

1. Click on User Levels in the left pane,


2. Select an integer field in your user table as the [User Level field],(note: if this field is not set,
the feature is disabled)
3. Switch to the [Dynamic User Levels] tab, check [Enable Dynamic User Levels],
4. Select your User Level Table and User Level Permission Table and the required fields.

The User Level Table and User Level Permission Table must have the following fields, note the data
types, User Level ID and the Permission fields must be of integer type, the field names can be different
though:

If you want PHPMaker to create these 2 tables in your database, click the [Create tables] button, the
following form will display for you to change the table/field names if necessary. You can change the
table/field names and then click OK to continue.

If you have projects created by previous versions of PHPMaker you may want to use dynamic User
Levels and migrate the previously defined static User Levels in the project to the database. After
selecting or creating the User Level and User Level Permission tables/fields, just click the [Migrate]
button to let PHPMaker do that for you.
After setting the user levels, PHPMaker will populate the user levels to the User Level field's Edit Tag
(also see Field Setup) so administrators can assign user levels using the generated pages.

There are two built-in user levels:


Administrator - Administrator user level is a built-in user level that has all permissions plus the
privileges to modify User IDs and User Levels. Its permissions are same as that of the hard-coded
Administrator Login
Default - Default user level is built-in user level with user level = 0. Since User Level field is an
integer field, if you set a default value of 0 for this field, this user level will become the default user
level for the user after registration and before the Administrator assigning another higher user level.

The Anonymous built-in user level in previous versions is deprecated. Use the new [Anonymous
User] (see above) to configure permissions for users before login.

Notes: You may need to use the hard-coded Administrator Login to log on and assign user levels to
users initially.

User Login Options


User Login Options allows you to create a complete user registration system for your Web site, with
options to let user register, change password and recover password.
User Registration Page Generate user registration page and add a link in login page.

CAPTCHA - Optionally use CAPTCHA for registraion form.


Confirm before submit - Optionally let user view the input
before submitting the registraion form
Send email - Optionally send email confirmation after
registraion
Requires activation - Optionally requires user click an
activation link in the email sent after registration to activate the
user account. (Send email is required.)

Note: CAPTCHA function requires CAPTCHA extension,


click Tools->Extensions from the main menu to enable. Also
see Third-party Tools.
Change Password Page Generate change password page

Send email - Optional email confirmation after changing


password
Password Recovery Generate password recovery page (forgot password page) and
Page add a link in login page. User name and password will be sent
to the user's email address.
User email address field Email address field in user table used for sending email
User activated field Email activated field in user table used for storing the status of
user. A boolean field is recommended, although an integer
field or a string field will also work. (PHPMaker consider
enum('Y','N') and enum('1','0') as boolean fields.)

Notes:

1. To enable user account activation, the Requires


activation and Send email options under User
Registration Page must be checked. The user needs to
click an activation link in the email sent after
registration to activate the user account.

2. If enabled, make sure the activated field for existing


users in your user table is updated with your activation
values (e.g. 1/0, Y/N) or the existing users cannot login
because they are not recognized as activated. You can
enable Multi-Update feature for the user table so
administrators can activate or deactivate existing users
easily.

The email sending function and the email contents can be customized in the template. The following
special tags are used in the email templates:
<!--$From--> is sender email address
<!--$To--> is user email address
<!--$Password--> is user password
<!--FieldName--> (without the $ symbol) is the field value.

For example, <!--LastName--> is the field value of the field "LastName".

The email format can be either "TEXT" or "HTML".

Also See:

Tutorial - User ID Security


Tutorial - Static User Level Security
Tutorial - Dynamic User Level Security
Tutorial - User Registration System

HTML Settings
General
Title Title displayed on all the PHP pages
Charset Charset setting (not specified if not entered)
Font Default text font (not specified if not entered)
Size Default text size
Site header logo Logo image in the header
Site footer text Footer text (e.g. copyright statement)
Header color Background color of the header banner
Footer color Background color of the footer
Footer font color Text color of footer text
Left column color Left column (menu column by default) color

Body
Background Color Background Color (<body> tag bgcolor= property)
Text Color Text Color (<body> tag text= property)
Link Color Normal HyperLink Color (<body> tag link= property)
Visited Link Color Visited HyperLink Color (<body> tag vlink= property)
Active Link Color Active HyperLink Color (<body> tag alink= property)
Left Margin Body Left Margin (<body> tag leftmargin= property)
Top Margin Body Top Margin (<body> tag topmargin= property)

Table

Width Table Width


Cell Padding Table Cell Padding
Border Table Border Width
Cell Spacing Table Cell Spacing
Background Color Table Background Color
Header Color Background Color for heading (field caption) cells
Header Font Color Color for heading (field caption) texts
Row Color First alternate row color
Alt. Row Color Second alternate row color
Highlight Color Color when mouse pointer is on the row
Selected Row
Color when row is selected (by mouse click or selected for delete)
Color
Background color for row in edit mode (for Inline-Add/Copy/Edit
Edit Mode Color
only)
Footer Color Background color for footer

Stylesheet

Edit A separate CSS stylesheet will be generated for each project. Click the [Edit
stylesheet stylesheet] button to open CSS editor.

Notes:

1. All projects use CSS stylesheet. The option of not using CSS
stylesheet is deprecated.
2. If you have TopStyle (Pro or Lite) installed on your PC, PHPMaker
will use it automatically.

When you edit the CSS styles in the editor, note the follows:

1. DO NOT MODIFY the system styles section, it is generated by the


system, your modifications will be overwritten. If you want to change
the stylesheet template, modify the ew.css in the "src" subfolder under
the installed directory. Only modify the ew.css if you have the
necessary knowledges in CSS.

2. DO NOT REMOVE THE FOLLOWING COMMENTS:

BEGIN_USER_STYLES
END_USER_STYLES

You MUST write your styles between these two comment lines, styles
outside this user styles section will be discarded.

3. If you want to override the system styles, you can copy the styles to
the User Styles Section, or you can use a separate user stylesheet.
User
Linking to external user stylesheet (will be copied across during generation)
Stylesheet

You can see the effect of new settings immediately in the preview window at the bottom of the HTML
tab.

Other than choosing color from the palettes, the color picker can also pick color directly from screen
using the "eyedropper".

PHP Settings
General Options

Add shell (For Unix-based server only) If you put the PHP parser binary somewhere
call outside of the web tree of files, for example, in /usr/local/bin, you will have
to put a line similar to: #!/usr/local/bin/php as the first line of any file
containing PHP tags. (You will also need to make the file executable.)
Set locale Set locale information. PHPMaker uses LC_ALL and localeconv().
localeconc() is for PHP 4 >= 4.0.5 only. For pre-4.0.5 versions, PHPMaker
generated codes use the constants defined in phpmkrfn.php which you can
find in the template and customize it to suit your needs.
No Cache Whether caching is required on browser
Replace
CR+LF by For memo fields
<br>
Use mysqli Use mysqli extension instead of MySQL functions.
extension
Notes:
1. The mysqli extension is designed to work with PHP 5 and MySQL
4.1.3 or above,

2. Both mysql and mysqli extension are not installed by PHP 5 by


default. (See Introduction to PHP and MySQL)
Default yyyy/mm/dd, mm/dd/yyyy, dd/mm/yyyy,
Date yyyy-mm-dd, mm-dd-yyyy, dd-mm-yyyy,
Format yyyy.mm.dd, mm.dd.yyyy, dd.mm.yyyy
Audit Trail Log file folder - The folder where the audit trail log file resides.

Important note:

1. Make sure that the Web server user have read/write access to the
folder. You can right-click the folder and add read/write access for
IUSR_<MachineName> on the Security tab.
2. The path is relative to application root. Use slashes "/" as path
delimiter, no leading slash. e.g. If the application root of your website
is C:\Inetpub\wwwroot\demo and you enter "uploads/" in this
textbox, the folder for the log file will be C:\Inetpub\wwwroot\demo\
uploads.

Track login/logout activities - If security feature is enabled, login/logout


activities will also be logged.
File Upload folder - The global folder where the uploaded files resides. If you do
Upload not enter a specific folder for a file upload field in the Edit Tag panel of the
Field Setup page, all the uploaded files will be put in this folder.

Important note:

1. Make sure that the Web server user have read/write access to the
folder. You can right-click the folder in Windows Explorer and add
read/write access for IUSR_<MachineName> on the Security tab.
2. The path is relative to application root. Use slashes "/" as path
delimiter, no leading slash. e.g. If the application root of your website
is C:\Inetpub\wwwroot\demo and you enter "uploads/" in this
textbox, the folder for the uploaded files will be C:\Inetpub\
wwwroot\demo\uploads. If you are not sure which folder is
application root, please read Application Root.

Max File Size - Maximum file upload size in bytes

Allowed file type - The allowed file extensions of the uploaded files.
Separate the file extensions (without ".") by comma, e.g. gif,png,png)

Delete file on update/delete - Option to delete the uploaded file when the
field value is replaced, removed or if the record is deleted.
List/View Page Options (Global)

The following list/view page options are global for all tables. If you want different settings for a
particular table, you can use table-specific options available in the Table Setup page.

Records per Number of records to be displayed on the list page of all tables. If blank or
page 0, default setting of 20 will be used.
Selectable Number of records to be selected by user. Comma separated values, e.g.
page sizes 10,20,50,ALL.
Note: "ALL" (without quotes) is supported, other values must be integers.
Paging
"NumericPages" or "NextPrev"
section style
Sort type None, Single column or Multiple column. If Multiple column is
selected, the generated list page supports multi-column sorting by Ctrl-
clicking the table header.
Multiple Show multiple records per row. Default is 0. This feature will only take
column effect if the value is > 0.
Paging
Show the paging section at top (also applies to View page)
section at top
Paging
section at Show the paging section at bottom (also applies to View page)
bottom
Enable
paging
Show paging section in View also
section in
View page
Multiple
Show checkboxes in the list page for selecting multiple records to delete
delete
Inline delete Delete records directly without showing delete confirm page
Links on left
Show the links on the left instead of right
side
Export CSV/HTML/Excel/Word/XML - Records can export to CSV, HTML,
Excel, Word or XML format. HTML format can be used as a printer
friendly version.

XML Encoding - The XML encoding for export data in XML format.
(XML document requires encoding so the data can be read by XML parser
properly. If your table/field names use English or alphanumerical
characters only, you can leave the encoding blank. Otherwise, you need to
specify an encoding.)

Enable export in View page - allow export in View pages also

Known Internet Explorer issue:


For known MIME (Multipurpose Internet Mail Extensions) types such as
Microsoft Word ("application/ms-word"), the default behavior of some
older versions of Internet Explorer is to open the document in the browser.
Also, to allow user saving the file with a proper file extension (otherwise
the file extension will be .php), PHPMaker uses content-disposition header
to override this behavior by default. For example:
Response.AddHeader "content-disposition","attachment;
filename=fname.ext"
When Internet Explorer receives the header, it raises a File
Download dialog box. However, if user clicks [Open],
Internet Explorer may fail to open the file. Therefore, you
may want to instruct user to save the file directly to the
user's disk without opening it in the browser.

Notes:
1. Binary data (BLOB fields) cannot be exported.
2. Export to CSV/XML are not applicable to reports.

3. Images cannot be exported to Word/Excel/CSV/XML.

Email Settings

PHPMaker supports many features that can send emails. If you use these features, you'll need to
specify a SMTP server.

SMTP server The host name or IP of the SMTP server.

By default the emails will be sent by Microsoft CDO using default SMTP
server on the Web server, in such case you can specify "localhost". But
sometimes the default SMTP server may be disabled, in such case you
need to specify another SMTP server.

Note: If you are still using Windows NT4 Server, using other SMTP
server is not supported by the CDONTS object, you'll need to choose
another email component (if available), see below.
SMTP server
Port number of SMTP server. Default is 25.
port
SMTP server
username User name for SMTP server authentication. If your SMTP server does
not require authentication, leave it blank.
SMTP server
password Password for SMTP server authentication. If your SMTP server does not
require authentication, leave it blank.
Sender (Email
address) Email address of the sender of all emails
Recipient
(Email Email address of the recipient(s) for notification emails when a record is
address) added/edited/deleted (if enabled). If there are multiple recipients, separate
them by comma.
Email The email components to be used by PHP to send emails.
Component
By default the emails will be sent by PHP mail() function which is a
built-in function of PHP. If SMTP authentication is required, you can
choose PHPMailer.

Note: PHPMailer is third-party components and is not part of


PHPMaker. No technical support will be provided. (See Third-party
Tools.)

Application Root

From PHPMaker 4, upload folders and audit trail folder are relative to application root. The change is
to enable the user to put the uploaded files and the audit trail log files in folder outside of the script
folder. (In previous versions, the file upload folder is relative to the script, it was supposed to be a
subfolder under the script.)

Where is the application root? PHPMaker scripts looks for the application root in the following
sequence:

1. Root Relative Path

Root Relative Path is the path relative to destination folder. The destination folder is the folder where
the generated scripts reside.

When you generate scripts, you must specify the [Application root folder] and the [Destination
folder] correctly based on your folder structure. The relative folder structure on your local computer
must be the same as that on your production server.

For example, if you put the generated scripts in a subfolder,


In this case, the Root Relative Path is therefore the parent folder of the script, i.e. "..". The scripts will
use this relative path to find the application root.

It is recomended that you set the [Application root folder] to the root folder of your Website where is
accessed by http://www.mycompany.com/ so you can specify your upload folder and audit trail folder
straightforwardly using the Website root as a starting point. For example, if you specify "upload/" as
upload path, since it is relative to application root, the upload folder will be accessible by
http://www.mycompany.com/upload/.

On your testing server, you may work with multiple projects and test your projects one folder level
lower at http://localhost/<projectname>/ (cf. http://<projectname>/). In this case you should set the
[Application root folder] in each project as the root folder of the project (the folder that is accessed by
http://localhost/<projectname>/). After uploading to the production server, the site may be then
accessed by http://www.mycompany.com/ (cf. http://localhost/<projectname>/), but as long as the
relative location of the two folders (Application Root folder and the script folder) are the same, the
scripts will still work properly.

2. Document root

If Root Relative Path is empty, the script check the following variables:
$_SERVER["DOCUMENT_ROOT"] or $_ENV["DOCUMENT_ROOT"].

This variable may be blank if you use IIS on Windows. But if you use Apache, it is usually the physical
path of your Website root. e.g. On Linux, it may return

/home/username/public_html which can be accessed by http://www.mycompany.com/

You can put your generated scripts in your Website root, or you can put the generated scripts in a
subfolder under your website root, e.g.
/home/username/public_html/scripts which can be accessed by http://www.mycompany.com/scripts/

When you generate scripts, you still need to specify the [Application root folder] and the [Destination
folder] based on your folder structure so that the relative location of the two folders is correct.

3. Script Path

If both Root Relative Path and Document Root are empty, the script will use the path of the current
script.

4. Custom Path

The above three approaches should handle most cases. If in some special cases they don't return the
path you want, you can modify the function ew_AppRoot() in phpmkrfn.php. You can simply specify
your real server path directly. For example,

Windows:

function ew_AppRoot() {
return 'C:\Inetpub\wwwroot\MyWebRoot\'; // replace with your real server path directly, include the
trailing path delimiter
}

Linux/Unix:

function ew_AppRoot() {
return '/home/username/public_html/'; // replace with your real server path directly, include the
trailing path delimiter
}

Remember that you must also check the value of the constant EW_ROOT_RELATIVE_PATH, make
sure it correctly points to your application folder relative to the script folder. Using above example, you
specify that the application root is "C:\Inetpub\wwwroot\MyWebRoot", if your scripts are placed in
"C:\Inetpub\wwwroot\MyWebRoot\MyScripts\", then EW_ROOT_RELATIVE_PATH should be "..".

TIP: You can call the PHP function phpinfo() (i.e. <?php phpinfo(); ?>) to view your server
information, including the server paths. Alternatively, in the generated scripts (that includes
phpfn<version>.php), you can call the PHPMaker function ew_WritePaths() (i.e. <?php
ew_WritePaths(); ?>) to view the path settings in your project. For example,

<?php
include("phpfn50.php");
echo ew_WritePaths();
?>
Project File

A project file is an XML file which stores database information and settings of a particular project. It
can be used as a good save-and-restart point for the customization process and is also useful as a trace
in case of problematic generation. It is therefore a good practice to save a project file for each site you
are generating.

Like other XML document, project file is human-legible. You should be able to open a project file in
any text editor. With a basic understanding of XML, you should be able to read an XML file and
change the settings.

Each template object is represented by an XML node in the project file. The object properties are saved
as attributes of the node. The property name is same as the attribute name.

Notes on Special Characters

XML documents can contain foreign characters, but it requires encoding so the data can be read by
XML parser properly. The encoding of the project file is auto-detected by our products according to
your computer regional setting. Generally, the detected encoding should be compatible with your
language. If not, you can override the auto-detected setting by explicitly setting an encoding to the
registry key:

HKEY_CURRENT_USER\Software\<product name>\<version>\Settings\General
Value name: XMLEncodeCharSet

XML documents cannot include special characters that are not belonged to the specified XML
encoding. Therefore, always avoid using special characters in your project setting. For example, iso-
8859-1 does not include the euro dollar sign. If you copy and paste an euro dollar sign from somewhere
to the project setting, error may occur when you save the project and the project file may become
corrupted. If you must use those special characters, always use the HTML entities, e.g. use "&euro;"
for the euro dollar sign. From PHPMaker 5, there is an alternative, you can force PHPMaker to save the
project file and generate output files as utf-8 encoded files by setting the following registry key value to
True (by default it is False). However, note that not all editors support utf-8 files, if you edit the utf-8
encoded output files with a Web page editor which does not support utf-8, the files might be corrupted.
Only use this setting if your project cannot be saved with the native encoding.

HKEY_CURRENT_USER\Software\<product name>\<version>\Settings\General
Value name: UTF8Project

Auto Backup

PHPMaker 5+ supports auto-backup. When you save a project, the old version will be saved to the
subfolder "<product name>\Backup" under the My Documents folder first, you can recover older
versions of your project from the backup folder in case of corrupted projects or other accidental losses.
Note that only the latest 10 versions will be kept, older versions will be deleted.
Project Name

Each project file has a project name. By default the file name (without extension) of the project file is
used as project name. Before you name your project file when saving it for the first time, a temporary
name, Project<n>, where n is a number, is used. The project name is an important property, it is used in
the generated codes to identify your project.

Note: It is recommended that only alphanumerical characters is used in project name.

When you want to create a new project based on an existing project, you can use [Save As...] under the
[Project] menu. If you want to create a backup copy or another version of an existing project, use
[Save a Copy...] to save the file with another name. If [Save a Copy...] is used, the project name is not
changed, so the project name is not same as the file name anymore. However, with the same project
name, scripts generated from these different project files will still work with each other like they are
generated from the same project file.

If you use IIS (Internet Information Services), our products can create virtual directory for your project.
The project name is used as virtual directory alias as well as the path under the default Web site of IIS.
Therefore, if you want to create a virtual directory with a specific name, you can save the project file
using that name first.

Also See:

Template Object Properties

You might also like