You are on page 1of 202

CLARION/PHP User’s Guide

2

CLARION/PHP User’s Guide

COPYRIGHT 1994-2003 SoftVelocity Incorporated. All rights reserved.
This publication is protected by copyright and all rights are reserved by SoftVelocity Incorporated. It may not, in whole or part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without prior consent, in writing, from SoftVelocity Incorporated.

This publication supports Clarion. It is possible that it may contain technical or typographical errors. SoftVelocity Incorporated provides this publication “as is,” without warranty of any kind, either expressed or implied.

Version 1.1
SoftVelocity Incorporated 2335 East Atlantic Blvd. Suite 410 Pompano Beach, Florida 33062 (954) 785-4555 www.softvelocity.com

Trademark Acknowledgements: SoftVelocity is a trademark of SoftVelocity Incorporated. Clarion™ is a trademark of SoftVelocity Incorporated. Microsoft®, Windows®, and Visual Basic® are registered trademarks of Microsoft Corporation. All other products and company names are trademarks of their respective owners.

Printed in the United States of America (1104)

CLARION/PHP User’s Guide

3

Contents:
Ch. 1: Introduction 7
Overview....................................................................................................................... 7 Road Map ..................................................................................................................... 9 Preparation ................................................................................................................. 11 Creating/Modifying the Application ............................................................................. 13 Adding Clarion/PHP ............................................................................................. 14 Procedure Customizations................................................................................... 15 Generating and Incorporating .............................................................................. 16

Ch. 2: Setup

17

Clarion/PHP Template Installation.............................................................................. 17 Apache Web Server Setup (Windows)....................................................................... 18 Installation Notes.................................................................................................. 18 Testing and Starting Apache................................................................................ 22 More on Testing ................................................................................................... 24 Final Note on Apache Setup ................................................................................ 24 Installing PHP (Windows) ........................................................................................... 25 Install Steps.......................................................................................................... 25 Testing the PHP Installation................................................................................. 29 Confirm the PHP Path.......................................................................................... 31 Installing ADOdb (Windows)....................................................................................... 32 Installation of ADOdb ........................................................................................... 32 Testing ADOdb..................................................................................................... 35 Linux Installation Issues ............................................................................................. 36 Apache and PHP: Testing.................................................................................... 37 ADODB ................................................................................................................ 38 Installation of ADOdb ........................................................................................... 38 PHP Include Path................................................................................................. 39 Database Setup ................................................................................................... 40 Running Clarion on Linux..................................................................................... 41 Default Virtual Images Directory................................................................................. 42 PHP, ADODB and Database Access ......................................................................... 42 PHP/ADODB Applications ................................................................................... 43 Database Access ................................................................................................. 44 Clarion Programmers and PHP/ADODB.............................................................. 45 FAQs and Troubleshooting ............................................................................................... 46 Configuring PHP ......................................................................................................... 46 How can I make sure that PHP will find the ADOdb support source files, when my generated code has a statement such as include(“adodb.inc.php”)?.................. 46 I am using MSSQL and I have an image on my form but it doesn’t display? ...... 46 How does PHP know what type of databases that it must support? ................... 47 Is there special configuration rules for PHP used with Apache? ......................... 47 Is there a simple way to keep all program images in the same place? ............... 47

4

CLARION/PHP User’s Guide ADODb ....................................................................................................................... 48 How do I install ADODb to my target server? ...................................................... 48 What is the best way to test an ADODb connection? .......................................... 48 Configuring Apache .................................................................................................... 49 How do I create a “virtual directory” using Apache? ............................................ 49 Deployment FAQ ........................................................................................................ 50 What do I need to do in order to deploy my application generated by the Clarion/PHP templates?....................................................................................... 50 What do I need to do in order to see the icons and images generated by the Clarion/PHP templates?....................................................................................... 50 HTML (Hypertext Markup Language) ......................................................................... 51 PHP Language ........................................................................................................... 53

Ch. 3: PHP Template Concepts

55

How PHP Fits In with Clarion ..................................................................................... 55 What’s Special About Our PHP Code.................................................................. 56 Interaction with Dictionary.................................................................................... 57 Navigational Links in Clarion/PHP.............................................................................. 58 Window and Control Formatting ................................................................................. 59 Security Levels ........................................................................................................... 59 Language.................................................................................................................... 60 Database Access - DBMS Requirements .................................................................. 60

Ch. 4: Getting Started Exercises Ch. 5: How-Tos

61 63

Application How-Tos................................................................................................... 63 Application of Global Template ............................................................................ 63 Application of Browse Template .......................................................................... 64 Application of Form Template .............................................................................. 65 Browse/Form/Browse or Query/Browse/Form ..................................................... 66 Link a Browse and Form ...................................................................................... 67 Form Without a Browse........................................................................................ 70 A Query Page....................................................................................................... 70 Browse to Browse ................................................................................................ 71 Select Browses .................................................................................................... 73 Table Loaded Selects on Forms .......................................................................... 74 How to Prime a Field on an Update Form............................................................ 75 Help and Popup Windows.................................................................................... 75 Testing How-To’s........................................................................................................ 77 Testing on Your Local Machine ........................................................................... 77 Integration/Deployment How-To’s .............................................................................. 79 HTML Template ................................................................................................... 79 Style Sheets ......................................................................................................... 80 Collected Data from Forms on Your Site ............................................................. 81 Passing Data to Other Parts of Your Web ........................................................... 81

........................ 99 Connection Parameters: ................. 147 Form Options/Custom Controls Tab ................................................ 109 User Data ......................................................................................................................................................... 113 Browse Options/Globals Tab ................................ 6: Integrating with Your Site 83 Links .......... 85 Ch.. 111 The PHP Frame Extension Template............................. 83 Site Standard Page Format ............................................................................................................................................... 89 List Defaults .................................................................... 132 Custom Columns Properties/Appearance Tab ...... 110 Includes.......................................................................... 122 Browse Options/Data Columns Tab.............................................. 90 Form Defaults Button .................................. 103 Global Options/Administration Tab ......................................................................................................................................................................... 123 Data Columns/General Tab ........................................ 97 Global Options/Database Tab...............................................................................................................................................................................................................................................CLARION/PHP User’s Guide 5 Ch.................................... 145 Form Options/Data Access Tab............................................................................................................................................................................................................................................................................................................. 112 The PHP Browse Extension Template .................................. 113 Browse Options/Page Tab ................................... 134 The PHP Form Extension Template........................................................................................ 143 Form Options/Help ........................................................................ 89 HTML Design Time Templates . 138 Form Options/Global Overrides .................................................................................................... 126 Data Columns Properties/Actions Tab.............................................................................................................................................................................. 130 Data Columns/Properties/Appearance Tab ........................................................................................................................................................ 153 ....... 87 Global Options/Cascading Style Sheets .................................................................................................................................................. 87 Global Options/Global Tab..................... 127 Data Columns/Properties/Column Sorting Tab......................................................... 138 Form Options/ActionsTab ........................... 107 Images ............................................ 119 Browse Options/Default SQL Tab....................... 117 Browse Options/HTML Table Tab.......................................................................................................................................... 146 Form Options/Controls Tab........................................................................................................................ 93 Global Options/Generation Tab ...................... 142 Page to Return To........................ 7: PHP Template Reference 87 PHP Global Template Options .............................................................................. 102 Global Options/Security Tab ................................................................................ 131 Browse Options/Custom Columns Tab..

.... 173 Ch................................................................................................................................ 163 Additional Form Embed................................................... 188 Margins Button ........................................................................................ 183 Background Class Tab ................................................................................ 172 Final Notes................Data Tab..... 163 Form Embed ................................................................................... 195 Style Sheets........................................................................................................................................................................................................................................................................6 CLARION/PHP User’s Guide Ch.......... 8: PHP Embeds 157 Global Template Declarations .......................................... 10: PHP Source Code Procedure 175 Application ..................... 194 Input Label: Data Tab.................................................................................................................................................................................... 189 Padding Button ............................................. 158 Accessing the Embed Points.......................... 9: HTML Includes 169 Understanding the Process ............ 177 Ch............................................... 166 Browse Embed................................................................. 189 Header Button ............................................................................................................................................................................... 159 Examples .................................................................................................. 186 Borders Button .. 11: Style Sheet Editor 179 Style Sheet Tab .......................................................................Data Tab .................................................. 190 Column Label Button ................................................................................................................................................................................................. 197 Index: 199 ..... 159 Browse Embed Points .......... 195 Input: Data Tab ....................................................................Data Tab ........................................... 191 Data Rows Button .........................................................................................................................................Data Tab .................................... 169 What to Use it For................................. 180 Body Tag Tab ................................Data Tab .................................................................................................................. 167 Ch... 192 Footer Button: Data Tab...................................................................... 175 Usage .................................................Data Tab ...

or delete record).CLARION/PHP User’s Guide 7 Ch. In essence. each of which serves to publish a standard business procedure such as query a table or view. Clarion/PHP allows for a high degree of customization of the interface. Both Clarion/ASP and Clarion/PHP can be applied within a single application. Clarion/PHP reads your data dictionary and builds a default procedure (as an extension to your existing procedure). Then you customize the Clarion/PHP procedure settings using the template interface. change record. allowing for excellent integration into existing sites. and can’t see variables contained on the previous or next pages). using the template interface and an HTML template which will act as a “setting” into which Clarion/PHP will place the controls it generates. browse (display and allow navigation through the results of a query or a table). for the developer familiar with creating desktop applications: • The modular application pages that Clarion/PHP generates fit together with links. Overview The following is meant to convey a conceptual summary of the Clarion/PHP code generation process. You’ll also build a connection string (using a wizard) that tells ADODB how and where to access the database server. rather than the formatters or Clarion embeds. or updates (add new record. whether *nix or Windows based. You’ll create a style sheet that controls the appearance for everything. Clarion/PHP is one component (the other is Clarion/ASP) of the Clarion web templates. and be managed with the same extension options (other than certain global settings such as database access). Clarion/PHP uses an open source data access library called ADODB which allows data access from PHP code. in fact a web developer may safely edit the HTML and Cascading Style Sheets which provide the “setting” for the database “components” without fear of “breaking” the php code. The target platform is Apache. All business and application logic is strictly divided from the interface. This helps the template create a pseudo application flow for stateless http (stateless means that each page is isolated. This is roughly equivalent to • . these items function as the database/driver/tables settings for the application. You therefore apply Clarion/PHP to the individual procedures for which you want to provide web access. specifically public or high volume sites using Apache. 1: Introduction This chapter summarizes Clarion/PHP programming and deployment. This makes it important that you use the Validity Checks tabs in the dictionary for all related fields. Clarion/PHP generates PHP pages (“PHP” originally stood for “Personal Home Pages” but has outgrown that acronym considerably).

and five times for the forms. • • • Note that you apply the Clarion/PHP templates first as a global extension template. incorporation of various images stored at the site.8 CLARION/PHP User’s Guide setting global window and control appearance properties for your application (all of which can be overridden at the procedure level). for which you wish to enable PHP for five browse and five form procedures. • You can add many further behavior or appearance customizations through the template interface. and copy them to an Apache server. if your application has fifty procedures. . You (and your web administrator) are then free to further customize the generated pages (for appearance. these may include links to other non-Clarion/PHP generated pages at the site. etc. When you apply the browse extension template to a browse. Apache.. it will automatically create a link to the appropriate update form. which is equivalent to deploying the application.). then apply the PHP browse template five times. etc. but you must manually apply the form extension to its update procedure. i. These function as the directives (and to some extent in the case of custom links. In this case. In addition to the various database behaviors in your application. application behavior. In other words. Then you integrate the pages into your existing web. you’ll first apply the global template. generating source code is all that is necessary. once for each of the five browses. PHP and ADODB are available for all current Windows platforms.e. and then on a procedure-by-procedure basis. You’ll generate the pages. no compiler needs to be called because PHP is a scripting language. embedded code) that tell the Clarion Application Generator what customizations for functionality and appearance to place in the generated code. so the developer may test and debug the application on the machine that they develop on.

e. The developer tests the various procedures locally using the Clarion/PHP generated menu page and optionally.” • The developer starts with a Clarion database dictionary describing the structures in an SQL DBMS (hereafter. (As an example. The developer customizes the various fields within each procedure where necessary. look and feel options. mysql.CLARION/PHP User’s Guide 9 Road Map Detailing the actual steps summarized in the “conceptual” overview above. and control pre-formatting. a local copy of Apache. type of access. The developer applies the browse and form procedures respectively to the browses and forms in the application. in preparation for running the application wizard. additional indices where a sort order request is expected. The developer links additional procedures as needed using the design time interface. The developer pre-formats the dictionary to include all relations. at that time. the HTML design time template. but also to a browse of all products by the supplier of the original product. and the style sheet options. using the design time interface. IBM DB2.app file and manually populates browse and form procedures). Postgres. The developer decides which procedures require PHP page equivalents.. Clarion/PHP reads the list boxes (for browses) and windows (for forms) generated by the application wizard in order to determine which fields it should populate in its tables (for browses) and forms. • • • • • • • • • . i. business rules. and/or a browse of all products in the same category as the selected product). from “scratch. the database. a navigational list view (browse) of a “products” table might link not only to the update form for the product. The developer runs the application wizard (or creates an empty . DBMS will refer to any client server relational Database Management System such as Oracle. in the order that the fields appear in those structures. plain English descriptions for tables and fields. The developer optionally adjusts the field order within each table as well as sets the “do not populate” options as appropriate. the global connectivity. etc). The developer applies the Clarion/PHP global extension template. specifying. the database server. this section provides a simple overview of the development and execution of an application.

The developer and web administrator together provide links as needed. The developer generates the pages and tests them locally. . or look and feel. to/from the rest of the site to the PHP pages. and upload the PHP pages for deployment.10 • • • • CLARION/PHP User’s Guide The developer fine tunes each procedure as necessary. The developer and web administrator together may optionally “fine tune” the generated pages. whether for application logic.

• • • • • Every table you require should exist in the dictionary. This makes it easy to create a browse displaying the same data. should you intend to use it in the PHP pages. A helpful hint: remember that there will be no such thing as “reports. if no such functionality exists within the current database. Clarion/PHP. Every view. Such a report can easily be made read only. fill in the “description” fields for tables. Clarion code in template embed points is completely ignored. The starting point should be a data dictionary referencing an SQL database. security access level and email addresses. keys and columns.” (Every HTML page full of data is already a formatted document).e. Note that Clarion/PHP picks up all its formatting options from the dictionary. If you wish to set a particular field order. Every table should have a key defined with a primary attribute (in the Clarion dictionary. and in what order. a field(s) selected that can later be specified as an SQL “Order by” clause. you may do so in the dictionary. The only thing that • • • . We encourage you to work with the database administrator to create VIEWs. you may wish to examine the underlying Clarion VIEW structure and create or ask the DBA to create a similar SQL view. See Global Options/Security Tab for details. All the access syntax generated in your php procedure pages will be ADO/SQL specific. ignores the control formatting customizations in the procedure. These will function as default “tool tips” in your Clarion/PHP application. and instead reads the customizations in the dictionary. It only refers to the window in the procedure to determine what fields to populate. Note that Clarion/PHP was not designed for ISAM databases. start with a data dictionary.CLARION/PHP User’s Guide 11 Preparation As with normal Clarion programming. not from any attributes added to a control in the window formatter. In general. Within the dictionary. if applied to an existing application procedure. should have at least one “key” defined. If you’re deploying an SQL/PHP version of an existing Clarion desktop application which utilizes an ISAM database. Unless you don’t require security at all. Every relationship should be properly defined. passwords. If an existing application contains some useful reports that access multiple tables. and you can set the number of rows to display to as many rows as you wish. we also encourage you to work with your DBA to create triggers to replace some of the business logic in the desktop application. i. the DBMS will no doubt have a primary key).. you should add. Remember that since Clarion/PHP outputs only PHP code. a users table which will hold user names.

Fill in the Validity Checks tab in the Fields Properties dialogs wherever possible. Check that the template has populated the proper SQL date/time field in cases and not fields for which the dictionary import wizard has automatically created a GROUP over that date/time field. Clarion/PHP can then populate a list filled from the related table. Set the Justification option on fields as necessary. In general. Bear in mind that some attributes will be ignored (e. fill in ranges. and the columns within a list box within a browse procedure. Fill in the description and prompt text for all fields you expect to populate. When you place a file drop list control template. the less need for communication of error messages between the DBMS and the end user. not the Group or its components. • • • • All the above actions emphasize storing application design in the dictionary as much as possible. or combo drop control template in a Clarion window. font.g. not just entry “boxes. mouse cursor) because they are not supported in HTML. using the “Must be in File” option on primary/foreign key relations. Clarion/PHP uses the SQL date/time field. the more client side validity checking your PHP application can do.”) • Check the “Do Not Populate” option for all tables. so that Clarion/PHP can generate JavaScript client side validations. as opposed to entry boxes) and control properties for fields wherever possible. Many Clarion developers already do so as a matter of course.. which is an excellent every day strategy for any Clarion developer who creates multiple applications which access the same database whether using Clarion/PHP or not.12 CLARION/PHP User’s Guide Clarion/PHP will pick up from the window formatter will be the fields list: those fields present as entry controls in the update forms. (Note: in this case. “entry” refers to any control that accepts user entry. true/false. Set up window control types (such as radio buttons. keys and fields you will not wish to populate under any circumstances. Must be in List wherever possible. transparency. for non-linking fields. . Additionally.

You may also take the following actions. and not populate any files. in effect creating a blank application tree. The reality is that the desktop and PHP applications will share no code. we suggest starting a new application. The HTML pages produced won’t have tabs leading to child or select browses. only a dictionary. (Note that you may apply Clarion/PHP to applications utilizing either the Clarion or ABC template chains). such as ID numbers. It’s a simple organizational issue: In the existing application you will no doubt have procedures you don’t wish to put on the web. File Drop Lists. and you may have source and report procedures which you can’t put on the web. You may then instruct PHP not to display any unwanted fields. and add in the “Product_Name” and “Last_Name” from the related tables.” and “Person_ID” from the Orders table. which will facilitate viewing and navigation across tables for the end user: • Add Field Lookup Buttons. For other developers. “De-normalize” the data in the browses. use the list box formatter to link in the Products and SalesPerson tables. and File Drop Combos to windows to facilitate navigational flow. You may then add “ToDo” procedures and use the browse procedure and form procedure wizards. Clarion/PHP will automatically add the JOIN syntax and display data from the three tables. Many developers will prefer to keep everything (desktop PHP and ASP) in one code repository. it may be most straightforward to create a new application. When you’re ready to create the PHP pages. all you need do is choose Project > Generate all from the development menu. If a browse contains “Product_ID. as opposed to pressing the “Make” button. • . these actions will allow the end user to either drop a list or press a button to navigate to related data.CLARION/PHP User’s Guide 13 Creating/Modifying the Application While in fact you can simply add the PHP Application extension to an existing application and then take the procedures you wish and “PHP-ize” them. This is merely a recommendation.

The global extension merely sets the defaults. which provide for an ADO-like syntax on many OS platforms. others to view it and still others not to view it at all) very straightforward. After setting the global extension. The style sheet is much like a style list you may be familiar with from word processors. etc.14 CLARION/PHP User’s Guide Adding Clarion/PHP You’ll apply Clarion/PHP as a global extension template. Using style sheets allows the web site to completely change the “look” of the site by editing only a single file. which holds the coloring. you’ll also set security options. in effect. . for each “part” of a browse or form. and thereafter all your generated pages will appear inside your template. It uses the ADODB libraries. For Clarion/PHP. or do it afterwards. When you add the global extension. The Connection will provide a dialog for you to choose your database target and build your connection string. A connection string is merely a list of parameters that ADODB requires to access the database. You may define the style sheet and the HTML template when you apply the global extension. you must define a connection string. you’ll use a separate style. add a single text symbol. At the global level. sizing and font attributes choices. which allows us to standardize the access code for both PHP and ASP. by choosing the “PHP Global Extension template”. you then add the PHP browse and form procedure templates to the procedures for which you wish to generate PHP pages. The HTML design time template provides a “setting” for the browses and forms. you may place HTML elements such as a logo or text above and/or below the browses and forms. Clarion/PHP makes implementing a flexible security policy (for example. You must add the global extension before you add any procedure extensions. font. You cannot apply the procedure extension templates until you’ve added the global extension. set page background colors. This manual contains detailed instructions on the template interface options for the global extension. you may allow some users to edit certain data. Your PHP application does not use Clarion drivers. you may easily take this. If your site already has a “template” for web pages. and you will not generate any PHP procedure pages unless you’ve then added the PHP procedure templates to a procedure(s).

You may wish to specify security levels for the forms. In many cases. and.CLARION/PHP User’s Guide 15 Procedure Customizations You’ll apply the procedure extension template only to those procedures for which you wish to generate PHP pages. If you defined the “Must be in table” options in the data dictionary. There are two reasons for this. which may contain an image linking to another procedure or even to a page elsewhere in your site. we recommend limiting the number of columns to four or five. from <a> to </a>. This allows you to define access as edit/view/none dependent on the user. the more data in the table. If you wish. or define link fields. You’ll also have an option to either allow for a “button” at the left or right of a browse row to link to an update form. They require a little HTML knowledge but can be very powerful. server. links to parent tables can provide a “select” button that provides for a popup window of allowable values from the other table. which instead populates a file loaded dropdown list box for the end user to choose from. You can also include “custom” columns. so that when the end user clicks a data item in a row it opens the update. you may instead populate a file drop control template in the form window. your data displays in a table that is not scrollable. the more network communications and memory usage are required by browser. There are many additional options documented within the command reference section of this manual. Custom links provide you with total control of the link code. and DBMS. In general. you’ll elect to edit the list of fields contained within the browse. .

view form. In fact. we suggest testing them using a web server either on your development machine or within your Intranet. and probably also that the site can provide a frame and links to the procedure pages. You’ll find that Clarion/PHP pages work well with existing pages in the site. and that this manual documents how such cooperation works. It’s important to realize that each browse. Or you may wish to collect data on a Clarion/PHP form and post that to an existing form.16 CLARION/PHP User’s Guide Generating and Incorporating When you’ve generated your pages. update form. when incorporating them into your site. . you can “pre-fill” data fields within a Clarion/PHP form by posting the data from forms that may already exist at the site. you may also wish to consult with the web administrator so that your style sheet will complement the site’s current styles. in cooperation with the web administrator. Afterwards. or Query-by-Form can be called from any other page in the site.

Developers bring with them very unique advantages that web designers could not be expected to bring. PHP and ADODB (to help insure that the developer installed them properly) notes regarding setting up Apache. it’s for developers who want to create PHP. and will install the templates. Based on our research. which reflects the resolution of whatever script(s) were run. The former (Apache) requires fewer resources. When running as a module. which passes it to the web browser. this section will also provide: • • This introductory section will also begin with an overview of PHP technology to Clarion and other database developers who may only have passing familiarity with it. At its simplest. Clarion/PHP comes from the opposite direction.CLARION/PHP User’s Guide 17 Ch. basic testing instructions for these Apache. The PHP library examines the page. The web browser receives only the HTML. the script has access to all the resources that the Apache user account on the web server has. PHP and ADODB (because it’s anticipated that those products will be new to many Clarion developers). and “writes” an HTML page. PHP has so far been the province of web designers who have learned something of development tools because they had to. It passes the HTML to the web server. and never sees the scripts that produced it. to help you understand what you’re installing. we think that the Apache Web Server is the most popular platform for PHP applications.PHP. It receives a request from the web server for a page whose file extension is .. ADODB. . PHP can be executed from either an Apache module or as a standalone CGI (Common Gateway Interface) application.. Make sure to exit the development environment completely before running the template installation. PHP is a form of server side scripting. PHP. Clarion/PHP Template Installation The Clarion/PHP setup program is straightforward. 2: • Setup basic setup instructions for Apache. runs its embedded scripts. in areas of programming efficiency and data management. and MySQL on Gnu/Linux (because it’s anticipated that this will also be an important deployment platform) In addition to providing simple setup directions for the Clarion/PHP templates.

you may wish to visit the home page of your distribution. Note that in many distributions.0. For the production environment on Unix or Windows. This is a valuable resource not just for downloads but for news of patches and other products. allowing for quick and immediate testing of applications." and apt-get is usually just apt-get and the package name. . Note that your download may be located in a directory called httpd." The Windows version will have "win32" in the file name. Once you’ve opened the page. The installer uses the Windows installer. which may be easier to install/upgrade. which when launched contains a list of cooperating FTP servers maintaining copies of the current release. and which version if installed. Note: if you wish to update a version of Apache on your Linux server. it is recommended that you install Apache 2 for testing purposes only. Installation Notes You may already have a web server (IIS. “rpm -q Apache.39 (Windows 32. Personal Web Server. Clarion Application Server) installed on your development machine. we will document the Windows install.39win32-x86-no_ssl. The installation/setup file.” will display whether Apache is installed. Choose a mirror and locate the proper download file. was called apache_2. Normally the syntax for upgrading an rpm is "rpm -Uvh apache*. before installing the Windows version on your development machine. use the latest Apache 1 version. in order to locate an RPM or apt-get package. such as RedHat. Apache is installed by default. In this section. as downloaded from an Apache mirror. double click the installer to begin. If running a distribution using RPMs. The "d" stands for daemon." to determine the current version.0.exe.18 CLARION/PHP User’s Guide Apache Web Server Setup (Windows) Many developers will wish to install Apache on their development machine. The first step is to download the Apache software. click on the link for "HTTP Server. Visit http://www.org for the home page of the Apache Software Foundation. This of course may change. A "Download from a Mirror" link is also on that page.apache. NOTE: At the time of this release. It is not currently recommended for the production environment. no Secure Sockets Layer) on Windows 2000. which is the *nix term for what Windows calls a "service. This chapter documents the installation of Apache 2.

CLARION/PHP User’s Guide The installation wizard begins with a simple introductory screen. may be surprisingly brief: . 19 The License screen. if you've never installed open source software.

It won't "hurt. The only component not installed with the typical option are the build headers and libraries. You can change both settings later. Your server name.. and the domain in that context is usually a dot. though it's usually traditional. . you may set Apache to install itself on port 8080 (the normal web server port is 80). and if so. Your administrator email address. followed by the domain information. Typical installation is probably OK for most developers. • • • The next installation wizard panel allows you to specify typical or custom installation. it's assumed that you wish the server to be started manually (as opposed to every time you boot the system). you may choose a few important properties for your server: • Your domain. feel free to leave the NT/2000 domain information in. Following that. Probably the most important setting to specify on this screen is the server port.com.. choose Typical. unless you think you wish to modify and compile the Apache source.20 CLARION/PHP User’s Guide Next is a small screen of information and links for additional information.net domain! But if you're running on a Windows domain for development purposes. dot. It need not be in the same domain. this does not necessarily mean a Windows domain.org or dot." and you can change it later. Note that if you are not already running another web server. however these are reasonable defaults for a development machine. Remember that Apache runs the majority of web servers on the Internet.

and then an announcement panel states that everything is ready. and that you can press the Install button to begin copying the files. you should see a final panel stating that installation was successful.CLARION/PHP User’s Guide 21 The next panel simply asks you to specify the installation destination directory (press the button should you wish to specify another. . Following the copying of the files.

In Windows. which are probably no further than you'll need to touch on a development machine. It works with little flash.52" (your install version number may vary).22 CLARION/PHP User’s Guide Testing and Starting Apache Assuming that you elected for manual Apache startup. which can indeed be vital in the "real" world of the World Wide Web have had books written about them. to edit your Apache configuration. but you'll not find anything on the level of Internet Services Manager. you'll edit a text configuration file (called httpd. and without fancy configuration tools. The basic options. In general. The following screen documents the actual command and response: This is a good introduction to Apache. Pay attention: an "OK" will flash by very quickly." This runs a console command. Some of the Linux distributions have already begun adding graphical configuration tools for Apache. are straightforward. A sub program group called "Configure Apache Server" provides a command called "Test Configuration. The more complicated options. and any subsequent running of the command will probably make it even faster.conf . the first thing to do is to test the configuration. Apache creates a program link group called "Apache HTTP Server 2.0.conf). a typical install places it at C:\Program Files\Apache Group\Apache2\conf\httpd.

0. enter its IP address here.0) Listen 12. you'll find an applet on the taskbar. in addition to the default.CLARION/PHP User’s Guide Here are some sections of the configuration file that you might want to change after installation. Don't be alarmed. ServerName your-machine-name:8080 # Timeout: The number of seconds before receives and sends time out. and this will make # redirections work in a sensible way. If you chose to install Apache as a service. See also the <VirtualHost> directive. # # If this is not set to valid DNS name for your host. though it may have less "relevance" . server-generated # redirections will not work.52 > Control Apache Server > Start Apache Server in Console. This will also be installed should you choose not to installed as a service. See also the UseCanonicalName directive. Again. Simply minimize it. it should already be running. # You will have to access it by its address anyway. but we recommend you specify # it explicitly to prevent problems during startup. # This can often be determined automatically. your version number may vary.. that's how it's supposed to look. to start Apache (assuming you've set it up for manual start as had been recommended above): Start > Programs > Apache HTTP Server 2. # # # # # # # Listen: Allows you to bind Apache to specific IP addresses and/or ports.56.34. Timeout 300 # After installation. Change this to Listen on specific IP addresses as shown below to prevent Apache from glomming onto all bound IP addresses (0.. This should lead to a completely blank console box.78:80 23 Listen 8080 # # ServerName gives the name and port that the server uses to identify itself. To control it.0. # # If your host doesn't have a registered DNS name.0.

one of the kernel toys for Windows 98) to verify that the Apache. you should see the following: Likewise. Final Note on Apache Setup Once Apache is started.exe process is running (or possibly two such tasks. without having configured a default page. To turn Apache off. . the Apache applet icon is the one at the right. More on Testing The proper way to test Apache is to open your browser and type in http://localhost:8080 (delete the :8080 if you installed to port 80). you can open task manager (or wintop. or to turn it back on again.24 CLARION/PHP User’s Guide In the illustration above. and turn it on or off by double clicking and choosing an option. use the popup menu from the toolbox applet. then locate Apache in the Windows services applet. the toolbox applet provides an "Open Apache Monitor" command. choose the "Open Services" command. Immediately following an installation. The monitor is for monitoring remote Apache installations.

We strongly recommend that you use the zip install. the following steps). this section documents the use of the PHP/CGI interface. Many Linux distributions pre-install PHP.CLARION/PHP User’s Guide 25 Installing PHP (Windows) PHP. Please be careful not to skip any steps. To download for your Windows development machine. follow these steps carefully to install. 1. Locate the file Install. the site is run by the PHP Group. You should see both a zip and an Installer version. a CGI (Common Gateway Interface. but we will use the more established PHP 4 version as our base install example. even if you choose the custom install. the installer for Windows doesn't install everything you need to work with Apache for Windows.php.net/. and PHP is also open source. 2. Will we mention differences in install configurations throughout this document where appropriate. such as C:\PHP (the standard suggestion) or C:\Program Files\PHP. . Download the zip file. (whose initials stem from its original name Personal Home Page) can be downloaded from the PHP group at http://www. and specify Apache. The PHP Group recommends the latter.txt file also contains instructions for different platforms and alternative configurations not covered in this document. Unzip the entire compressed file to that directory. The zip install will contain two “versions” of PHP. however the SAPI version will not run with Windows 2000 at the time this manual was written. Therefore.3. The latest version of PHP at the time of this release is PHP 5. be sure to do so (Note: unzipping should create several sub folders). The install. If your extraction utility requires you to specify a parameter or choose an option to create subdirectories under the target directory.9-Win32. Create a directory for your PHP installation. click on the Downloads link at the page mentioned above.zip (the latest PHP 4 version at the time of this writing).txt and be sure to review it (in case there are any differences in subsequent versions vs. in which the web server calls PHP functions directly. which for this “example” installation is named php-4. in which commands are executed from the web server) and a SAPI (Server Application Programming Interface. and open it with your favorite zip management tool. PHP is a project of the Apache Software Foundation. After reviewing the instructions. Unfortunately. Install Steps This documents the installation of the zipped version of PHP. and locate the Windows Binaries section.

leaving only the string. Save and Close the php. locate php. Locate the string “extension_dir =” and change the value to the directory to which you unzipped all the files to.ini file.tgz . Search for the string “Addtype. It may be necessary to create a file association.force_redirect = 1 7. which should be located in a directory called conf. extension_dir = "c:\PHP" 4. Directory in which the loadable extensions (modules) reside. # # AddType allows you to add to or override the MIME configuration # file mime. the following is the default section found in our installation: 10. Locate the string “cgi.conf file before editing. dialog. which should be located under the directory in which you installed Apache. 9.conf file in notepad (or your favorite text editor). Remove the semi colon and the space after it. 5.26 3. 6.. Copy it to the Windows directory (typically C:\Windows for Windows 9x and XP.force_redirect = 1” which should be on a line that is commented out (it begins with a semi colon). being careful to place double quotes around the directory should it contain any blank spaces. Stop Apache if it’s currently on. Also. because of the case sensitive nature of this file. # AddType application/x-tar .types for specific file types.. If you make a mistake.ini-dist will have been copied to the target directory. it is strongly recommended that you back up your httpd. 8. or C:\Winnt for Windows NT/2000). Example: . Locate the Apache httpd.” You should find it in a section with some comments above. using the Open With. CLARION/PHP User’s Guide A file called php. Example: cgi.conf file. In the Windows directory.ini and open it in Notepad or a text editor. which is located in a directory called Apache 2 (or Apache in earlier versions). you will most likely not be able to restart Apache. Open the httpd.

dll" AddType application/x-httpd-php .conf file: # For PHP 4 do something like this: LoadModule php4_module "c:/php/sapi/php4apache2. substituting the name of your PHP install directory for c:/PHP. and that the lines starting with # are just comments: # # inserted by YourNameHere for PHP Support ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.0.conf file: ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .exe" If you are installing PHP to use the CGI binary with Apache 2.php # configure the path to php.ini PHPIniDir "C:/php" . and not a backslash character.dll" AddType application/x-httpd-php .php # For PHP 5 do something like this: LoadModule php5_module "c:/php/php5apache2. add the following lines to your httpd.exe" # For PHP 5 Action application/x-httpd-php "/php/php-cgi. if you installed to a different target.CLARION/PHP User’s Guide 27 Insert the following lines below those lines. Note that the file locations use a slash character. add the following lines to your httpd.exe" If you are installing PHP to use the Apache module DLL with Apache 2.php # For PHP 4 Action application/x-httpd-php "/php/php.0.

.conf file: # For PHP 4 do something like this: # Add to the end of the LoadModule section LoadModule php4_module "c:/php/sapi/php4apache.dll" # Add to the end of the AddModule section AddModule mod_php5.phps files. also add AddType application/x-httpd-php-source . add the following lines to your httpd.c #For both add the following: # Add this line inside the <IfModule mod_mime.c # For PHP 5 do something like this: # Add to the end of the LoadModule section LoadModule php5_module "c:/php/php5apache. Save and close the httpd.dll" # Add to the end of the AddModule section AddModule mod_php4.x.c> conditional brace AddType application/x-httpd-php .28 CLARION/PHP User’s Guide If you are installing PHP to use the Apache module DLL with Apache 1.phps 11.php # For syntax highlighted .3.conf file.

you may have typed the section above wrong. 5. In Explorer. by opening a command console and typing the following at the c:\> prompt. omit the :8080). Note that PHP is case sensitive: <?php phpinfo(). and type the following URL in the address box: http://localhost:8080/test. Save the file and start Apache.exe" -t -f "C:\Program Files\Apache Group\Apache2\conf\httpd. If you receive an alert regarding changing a file name extension. Open the “test. Name the file “test. 1. . Right click and choose New > Text File in a blank area of the Explorer window." A “Syntax OK” message should appear.php. then the htdocs directory. 3. which should be located directly beneath the installation directory you chose for Apache. Be sure to include the double quotes: "C:\Program Files\Apache Group\Apache2\bin\Apache. ignore it. which should be one level below that.conf file is OK. save the file. Open your browser. Now verify the httpd.CLARION/PHP User’s Guide 29 Testing the PHP Installation You may create a one-line text file to test that PHP is working properly. and close it. 6.?> 2.php. 4. if not.php” file with notepad. Type the following line in notepad. (Note: if you did not choose port 8080. open the Apache2 directory.” or a similar name. This is the default web root. It may be necessary to create a file association in the “Open With” dialog.conf" -d "C:\Program Files\Apache Group\Apache2\.

You’ve now enabled PHP support. .30 CLARION/PHP User’s Guide The result should be a page looking like the one below.

For better maintenance.exe is called. Any directory in your Windows PATH environment variable. To make php4ts.CLARION/PHP User’s Guide 31 Confirm the PHP Path A final checkpoint is to make sure that the CGI and CLI binaries. the web server's directory (e. C:\php to the PATH.dll (php5ts. C:\Program Files\Apache Group\Apache2\bin). or in case you use a SAPI module. because it will be simpler to upgrade PHP in the future.dll / php5ts. . we advise you to follow the last option.dll) file to be available to them. You have to make sure that this file can be found by your PHP installation. add C:\php to the PATH. and the web server modules all require the php4ts. The search order for this DLL is as follows: The same directory from where php.g. or add your PHP directory. copy the file to the web server's directory.dll available you have three options: copy the file to the Windows system directory.

The simplest way to get started is to create an ADOdb directory under your Apache2\htdocs directory (your default web root).53-for-php. Using your favorite compression utility tool.sourceforge.C:\Program Files\Apache Group\Apache2\htdocs\ADOdb.32 CLARION/PHP User’s Guide Installing ADOdb (Windows) The ADOdb database library for PHP is an open source project whose home page is http://adodb.C:\Program Files\Apache Group\Apache2\htdocs\ADOdb\drivers" . please review the following configuration settings. For downloading to a development machine or a Windows based server.INI file.. PostgreSQL. Access. Sybase. A section later in this chapter discusses server installation. you will wish to download a zip file. ADO. The most current download is found at the page above. unzip all files to a directory accessible to your web server.53 for Windows.\path2" include_path = ".INI file where needed: 1.net. (This was the latest version at the time this document was released). Windows: "\path1. Interbase. If you have the ADOdb directory in another location. This allows Clarion/PHP to connect using the same SQL commands to different DBMS’s. search for "include_path =". you will download a . The databases supported by ADPdb are MySQL. DB2 and generic ODBC (when the server is Windows). In the PHP. preserving the directory structure of the zip file.0. Note that sometimes the text description will note that a previous version may be more stable than the most current version. For downloading to a *nix based server. The purpose of ADOdb is to provide a database abstraction layer allowing PHP to use a standardized syntax for access to different databases. and change as follows: If you are using Apache2. Informix. MSSQL 7. If you’re simply following these “How tos” and have freshly installed Apache. Foxpro. and change the PHP. as contained in adodb-4. Installation of ADOdb This section documents the installation of version 4. and then extract the files to that location. you probably haven’t set up any virtual directories yet.tgz file and run configure and an install script. Oracle.x: If ADOdb is installed under \Apache2\htdocs\: .

as it is not part of the install. Note: Windows users have to change this .C:\Program Files\Apache Group\Apache\htdocs\ADOdb\drivers" If ADOdb is installed under C:\PHP\: .For PHP 4 extension_dir = C:\PHP\extensions 3.c:\php\adodb\drivers" 33 If you are using Apache1..c:\php\adodb. variable in order to use PHP's session functions.3.INI file.CLARION/PHP User’s Guide If ADOdb is installed under C:\PHP\: .. Argument passed to save_handler.C:\Program Files\Apache Group\Apache\htdocs\ADOdb. Directory in which the loadable extensions (modules) reside. where data files are stored.save_path = C:\PHP\SessionData Note: Make sure that 'C:\PHP\SessionData' is created. and change as follows: . .\path2" include_path =". In the case of files.c:\php. Next. .\path2" include_path = ".\path2" include_path =". session. In the PHP.c:\php\adodb. Windows: "\path1. Windows: "\path1.save_path'.c:\php.. this is the path . search for 'session. Windows: "\path1.c:\php\adodb\drivers" 2.3.For PHP 5 extension_dir = C:\PHP\ext . search for 'extension_dir'.x: If ADOdb is installed under \Apache\htdocs\: . and edit as follows: .

for PHP 5: . as follows: .dll 4. Finally. and remove the '.' before the DLL that you are using to connect to the database. You may wish to review the information found in the FAQs and Troubleshooting section if you have trouble with the setup or testing in this section. so no dll is needed . You’ll also find a file called readme. we are using the MSSQL and MySQL drivers.Windows Extensions .extension=php_ming. .extension=php_oci8.for it.htm.for PHP 5 only: extension=php_mysql.dll . In the above example.dll . Save and close the PHP.34 CLARION/PHP User’s Guide 3. search for 'Windows Extensions'.INI file. Review that document in case there are changes to the install procedure in the next product updates. .Note that MySQL and ODBC support is now built in.dll extension=php_mssql.

CLARION/PHP User’s Guide 35 Testing ADOdb The tests directory. Access driver. the page should look like the following: Because connections strings differ depending on what database you may have. which will be located below the target ADOdb installation directory. and the error message will advise: “ERROR: Access test requires a Windows ODBC DSN=nwind. as illustrated below: . the connection creates a table in the northwind database called “ADOXYZ. If ADOdb is working correctly. The quickest. an error message will tell you what the test page expects “on the other end. and point it to the northwind. which will help you test that ADOdb is properly installed. press the button. load the ODBC Data Sources applet in Control Panel/Administrative Tools. retrieves and displays it. When you check one of the boxes and press the “Submit Query” button.php.” To test further. the test page will not successfully connect to any database right away.” As an example. and create a DSN named nwind.mdb sample database in the Microsoft Office\Office\samples directory (if you have MS Office installed). check the “Access” box. When first loaded. easiest test is to set up an ODBC data source for one of the sample databases that are hard coded into the test.” inserts test data. contains a page called test.

as described above. installed as part of their Linux distribution. mysql. and most likely. PHP. Additionally. you’ve now installed all the supporting components necessary for Clarion/PHP. this section will also touch upon Linux add on products which will allow developers to develop using Clarion and test locally on a Linux machine. Therefore this section is not meant to be a comprehensive guide to Linux setup. which means installing Apache. PHP and ADODB on Windows. Linux Installation Issues It’s anticipated that many Clarion developers will wish to use a single machine for development and testing. those responsible for maintaining the site will probably have good familiarity with installing and configuring the necessary components. Moreover. we anticipate that most sites will actually run Apache on Linux or UNIX. For deployment. . Because. this section will focus on installation and configuration issues for those two components. however. as well as seeking help in the many newsgroups should problems occur. Linux servers will most likely have Apache. a popular open source database. we anticipate that ADODB and PHP-mysql interaction will be the two most common areas in which questions may arise.36 CLARION/PHP User’s Guide With the installation of ADOdb. In most cases.

If testing on the local machine.1. and type http://localhost/mydirectory/Test. or more specifically. which must be run as root. you will receive a page not found error.” then perhaps Apache was not set to automatically start on that machine.2.php. your starting point will be to test Apache and PHP. You’ll see the exact same default document that Windows Apache servers provide.d/init.php. Save your text file to a directory within the web tree. the default Apache web root can be found as /var/www/html. This uses more resources. installs Apache 1. Load the page in your browser. only a single process is run for all requests and clients. The alternative is to run PHP as a standalone process from cgi-bin. Remember that Apache/Linux/unix is case sensitive! If you save the file to test. for example. We will take the approach of starting and configuring a Linux machine in your local intranet.3. with Linux.d/httpd start Just as you did for PHP with Windows. is: /etc/rc.3 and PHP 4.CLARION/PHP User’s Guide 37 In general. add ADODB.?> Usually. and is not necessary for Clarion/PHP. and optionally add a database such as mysql. If you did not see the “Test Page. The command to check varies by distribution.3. you may display the installation information by logging in as root and typing: rpm -q php . it should look something like: If the test page did not display. Begin by testing Apache. The command to start Apache varies from distribution to distribution. Apache and PHP: Testing Many Linux distributions automatically install Apache and PHP. PHP is installed as an Apache module. RedHat 7. Open a browser. This means that when PHP is invoked. though it’s simple to change that.php. one that you have access to so as to allow the installation of any missing software. check to see that it’s installed. the command to start Apache. but in RedHat. Use the text editor of your choice and create a file whose contents are as follows: <?php phpinfo(). to a file name such as test. you must create a test page for PHP. type http://localhost. In RedHat 7.

check the messages log (tail /var/log/messages) as root. The databases supported by ADPdb are MySQL. As a reminder. Should you not have PHP installed. just look for the Download link. . assuming installation disk #2 is loaded in the CDROM. This allows Clarion/PHP to connect using the same SQL commands to different DBMS’s. in fact. Again.” which is the package name and version. ADODB The ADOdb database library for PHP is an open source project whose home page is http://adodb. Once there. depending on the actual file name. Access.1.2-7. the command to install PHP. you may load your installation disks or download a package from the web.sourceforge. The simplest way to extract and install. Therefore you must obtain and install them. most knowledgeable users would replace all characters to the right of php-4 with an asterisk. DB2 and generic ODBC (when the server is Windows). is to load the resulting tar file in a file manager which treats a tar archive as a folder. Installation of ADOdb Create a directory and download the file to it. PostgreSQL. ADO. The most current download is found at the page above.net.tgz file and run configure and an install script. both Apache and PHP should have been installed for you.i386. The ADODB libraries will not have been installed on a default installation of any distribution that we know of. on any machine in which you’ve specified during installation that the machine is to be a web server. Foxpro. run gzip and uncompress it. and copy the contents to a directory you create for it in your web root. Informix. that in any other version the version numbers following “php” would be different. in the case of RedHat 7.tgz It’s not necessary to make and compile the libraries.38 CLARION/PHP User’s Guide This should return a string such as “php-4. You will download a . Note that sometimes the text description will state that a previous version may be more stable than the most current version. we named the directory /var/www/html/adodb. which should be something like: gzip -d adodb221.1. In our case.3.rpm In this case. Interbase. and guide you to that version.2-7.3. and finally. The purpose of ADOdb is to provide a database abstraction layer allowing PHP to use a standardized syntax for access to different databases. remember in case any of the daemons fail to work. Note also that the package manager will notify should any dependencies require installation first. and that the root is logged in: rpm -ivh /mnt/cdrom/RedHat/RPMS/php-4.4. Sybase. Oracle. Finally. MS SQL 7.

ini file in /etc. you must edit the php. make sure to edit the PHP.textsize = 2147483647 Default = 4096. mssql. there are default that needs to be changed in the MSSQL section of php. Values given here are the ones that replaced the default.2147483647. Valid range 0 . This will allow forms with images to be displayed correctly.ini file (yes. Default = 4096.:/php/includes” You must uncomment this (or add a path. if already uncommented) to include the directory to which you’ve extracted the ADODB libraries. On a RedHat distribution. In addition. and you plan to use MSSQL.2147483647. For example: include_path = “/var/www/html/adodb” If PHP 5 is installed. you’ll find the php.include_path = “. Valid range 0 . the default line began with a semi colon.INI in the Windows directory to "activate" the needed DLL extension. In the default installation under RedHat. mssql. it really is called that.textlimit = 2147483647 .CLARION/PHP User’s Guide 39 PHP Include Path Before you can use the ADODB libraries.ini: . . though it’s on a Linux server) to include them. Open the file as root. and search for the string “include_path” at the beginning of a line. commenting it out: .

it’s probably easier to test ADODB with a Clarion/PHP app!). again. that the sample database is called “test. using RedHat as an example. Again. load http://localhost/adodb/tests/test.3 as an example. insert disk 3 in the CD ROM drive. and follow the directions in that page to create a database table and display it. (Frankly. Should you wish. There’s still one more package to install.html . should there be a problem started the mysql daemon.d/init. using RedHat 7.php (assuming you’ve installed ADODB to the same location as noted above). As always. which is necessary in order for PHP to work with mysql. To start it. Remember that your command line client on Linux starts simply with the mysql command. generating test data is not as easy as under windows. that you’ll use the “use” command to load a database. and scrolling down to the mysql section. should you be creating an in house test bed for your application. you’ll first wish to install mysql. logging in as root: /etc/rc. and is located at http://www. however. from disk 3: rpm -ivh /mnt/cdrom/RedHat/RPMS/php-mysql* You now have mysql installed. a quick verification that everything is running. In many cases. you’ll be notified and should install the appropriate packages. The online mysql documentation is quite comprehensive. It’s very likely that this database was not installed with your distribution.” The terminal screen below shows a short mysql client session.mysql. though you’ll probably wish to begin creating your mysql database if you don’t have one already. and finally.40 CLARION/PHP User’s Guide Database Setup At this point you could test ADODB. or the “show databases. and as root: rpm -ivh /mnt/cdrom/RedHat/RPMS/mysql* Should any additional dependencies be necessary.d/mysqld start You should also at this point be able to pull up the PHP test page again and verify that PHP can talk to mysql by looking at the test page. and the “grant” command to add an account.” command to display the databases available. given a well configured system. and a yet to be executed command to add a new user. check the messages log as root (tail /var/log/messages). To install mysql. At this point you’ve got everything in place to begin testing.com/doc/en/index.

3 and Netraverse’s win4lin with Windows 98. neither is open source or free). but it can be run via virtual machine based products such as vmware and win4lin. Much of the testing of the system related to the development of this manual was done using a notebook computer running RedHat Linux 7. Note that both win4lin and Windows 98 require proper licensing (in other words.CLARION/PHP User’s Guide 41 Running Clarion on Linux Clarion will not run on Linux with binary compatibility libraries such as wine. This allows the Clarion developer to compile and test using Clarion along with Linux/apache/php/adodb/mysql (or other databases) on a single machine. facilitating editing design time and runtime HTML templates for your Clarion/PHP application. . The other advantage of this setup is that Dreamweaver can also be run on the same machine.

. this means that the script uses ADODB to frame queries or other requested actions for the database. the PHP script then examines this object and generates a web page with some result. making the solution quite scalable.42 CLARION/PHP User’s Guide Default Virtual Images Directory As a final note relating to setup. PHP manages resources efficiently. The library itself is modeled after the Microsoft ADO libraries. for the purpose of providing a common access syntax for many database back ends. you can override this location if you prefer to keep the images elsewhere). the ADODB library is the means of access. As you set Apache up on your development machine you should create this directory under your Apache web root. In essence. please see the section entitled “Testing On Your Local Machine. so that the Clarion/PHP button images can be found by your application (of course. note that many web sites have a directory in which they store frequently used images. For further information. and copy the images from (your Clarion directory)\images\php there. and receives a resultset (query result) from the ADODB library. usually called /images. The library interfaces between PHP and Apache on the one side.” PHP. ADODB and Database Access For database access. and the database client library (or optionally the ODBC layer if Apache/Windows) on the other. You probably do not have such a directory on your development machine.

because the end user only sees the user interface. Apache. They can be very scalable. The applications are secure. and the programming structure for them may not be as fully featured as other languages. therefore. Weaknesses: • The applications look and feel different than desktop applications. The applications are manageable at a single point (the web server). PHP and ADODB. and the interface shows only the data you decide to show. • .CLARION/PHP User’s Guide 43 PHP/ADODB Applications Think of your PHP application. can run on a huge number of server operating systems and be hosted on public servers with a minimum of effort. The scripting languages. as a browser-based interface to a powerful back end application. and upgrades require no action on the part of the end user. The server itself.. and a restricted selection of window controls may be frustrating to some developers. The Apache/PHP/ADODB platform has its strengths and weaknesses: Strengths: • • • • • • Your applications’ interfaces gain the advantage of being accessible from anywhere without requiring installation. i.e. The applications themselves can look very pretty and be very functional. issues such as window and thread management.

These statements are exposed in the procedure properties dialogs. in which case ODBC is not used. ADODB works within PHP with the declaration of a connection object. LastName from MyTable” returns the values of all the first and last names from all the rows of MyTable. ADO – Active Data Objects – is an ActiveX interface to ODBC access. and returns a result set: an array of database values. it’s not necessary for the Clarion developer to know the ADODB methods. ADO also provides interfaces to non-relational tables such as Excel spreadsheets. those Clarion developers with an excellent knowledge of SQL should feel free to modify the code should they feel they can make it more efficient. they are important if you wish to understand the generated PHP code. The template builds the necessary parameters. The open method of the connection object takes the connection string as a parameter. As an example. Using the resultset methods. “Select FirstName. Clarion/PHP is designed for use with Client/Server SQL databases exclusively. the developer can navigate through the database. The execute method of the connection object takes an SQL statement as a parameter. .44 CLARION/PHP User’s Guide Database Access In regards to relational databases. however. The Clarion developer need not be concerned with ADODB code. and opens the database. unless you wish to be concerned. Using the templates. The template interface also generates the SQL code. such as next and previous.

CLARION/PHP User’s Guide

45

Clarion Programmers and PHP/ADODB
This section provides a very brief introduction to how experienced Clarion programmers will work with Clarion/PHP. Here are the main points: • The biggest change is that you don’t program database access in Clarion. For lack of a better analogy, Clarion programmers must sit back and “let the templates drive.” You will continue to work with templates, the dictionary, and the application generator. The “look” of the application will be controlled through style sheets. You may choose to apply the global PHP template to an existing application or a new one. Once the global template is applied, you select the browse or form procedures for which you wish PHP pages, and apply the PHP browse and form templates to them. The options set by the window formatter to format the appearance and behavior of controls will not affect their PHP equivalents; however, any control you wish to appear on the PHP page must have an equivalent in the browse listbox (for browses) or in the WINDOW (for forms) structures. In other words, you can place a field with the window formatter, but everything else will be controlled in the PHP Browse or PHP Form extension dialog. These dialogs provide for a great deal of customization, both in appearance and functionality. To generate the PHP pages, you’ll choose the Generate All command, and then transfer the pages to your server. Your .APP file will still generate a Clarion/Windows desktop application, separately, safely ignoring your PHP options and scripts. As always, the Application Generator will safely regenerate new code when you make changes without losing old customizations.

• • • •

• • • •

46

CLARION/PHP User’s Guide

FAQs and Troubleshooting
The following section provides tips and checkpoints to ensure proper configuration and setup options for ADOdb, Apache, and PHP.

Configuring PHP
How can I make sure that PHP will find the ADOdb support source files, when my generated code has a statement such as include(“adodb.inc.php”)?
The PHP.INI file has an entry called include_path. You must enter in the string value all the directories where ADOdb support files are located. Each directory is separated in the string by a semicolon. For example, a typical entry in the PHP.INI for include_path may look like:
include_path = “.;c:\php\includes;C:\ADODb;C:\ADODb\drivers;C:\PHP\Pear;C:\PHP\Pear\gopear-bundle”

The drive letter in the string is the drive letter on the server where the files are located. Make sure that you always stop Apache and restart it after you edit your PHP.INI file. If the ADO database test fails from the test PROCS.HTM page, this path issue is most likely the cause.

I am using MSSQL and I have an image on my form but it doesn’t display?
There is a section in the PHP.INI related to MSSQL where the default may be not enough for large images. The entries that need to be modified are:
Mssql.textlimit Mssql.textsize

Both default to 4096 in size. Adjust these entries to the biggest size an image can have.

CLARION/PHP User’s Guide

47

How does PHP know what type of databases that it must support?
The PHP.INI contains 2 sections that need to be edited to add target database support. The first entry in the INI file that needs to be edited is:
extension_dir = C:\PHP\Ext

In this example, C:\PHP\Ext is the directory on the server where the PHP extensions DLLs (i.e., php_mysql.dll) are located. You need to enter the name of the directory where those DLLs are located. The other entry that needs to be “activated” is in the extension section. Search the PHP.INI file for this location:
;extension-php_myslq.dll

Note the semicolon preceding the extension entry. To activate this database, or any other database type for PHP use, remove the semicolon in front of the line corresponding to the target DLL.

Is there special configuration rules for PHP used with Apache?
Depending of the version of PHP and/or Apache, you may find invaluable configuration and setup information at the following site and links: www.php.net Is the definitive and best reference for anything PHP. Also, http://www.php.net/manual/en/install.windows.apache2.php contains information specific to Apache 2 and PHP versions http://www.php.net/manual/en/install.windows.apache1.php contains information specific to Apache 1.3 and PHP versions and for general Apache information: www.apache.org

Is there a simple way to keep all program images in the same place?
The best way is to create an Alias for the images in Apache httpd.conf configuration file. See the Configure Apache topic in this FAQ section for steps on how to create an alias.

48

CLARION/PHP User’s Guide

ADODb
This section covers important install and configuration issues regarding ADOdb used with PHP.

How do I install ADODb to my target server?
ADODb is a straightforward install process. You simply need to create a target directory on the web server and unzip the files to that location. After that, it is recommended to edit the PHP.INI located on the web server and add the target directory to the include_path entry. Example:
include_path = ".;c:\php\includes"

What is the best way to test an ADODb connection?
There is a file distributed with ADOdb that serves this purpose. The PHP source file for testing is named test.php and it is located in the tests subdirectory of the ADOdb install root. In order to use it, you must edit the testdatabases.inc.php file located in the same directory. This file contains hard coded values for server name, user id, password and the DSN for various database drivers. You must change the values to the one that will correspond to your needs.

deny Allow from all </Directory> Case sensitivity is important! Double-check and compare your entries to other Alias entries already defined. If everything is entered properly. you will be able to restart Apache. and it should now be possible to use Orders in the URL address to reach the directory specified in the Alias entry. Just make sure to stop Apache before editing the file and restart it when done. The way to create an Alias is to edit the httpd. . a virtual directory is called an Alias.CLARION/PHP User’s Guide 49 Configuring Apache How do I create a “virtual directory” using Apache? In Apache.conf file and create an entry similar to this: Alias /Orders “C:/MyApp/PHP/Orders” <Directory “C:/MyApp/PHP/Orders”> Options Indexes MultiViews AllowOverride None Order allow.

it is a good idea to have an Alias created for images. On the server. your application will run as generated. to have the include_path statement reference the appropriate ADODb directories. Ideally. If Apache and PHP are configured properly. copy all the PHP images from \Clarion6\Images\php\ directory to that location.50 CLARION/PHP User’s Guide Deployment FAQ What do I need to do in order to deploy my application generated by the Clarion/PHP templates? The Clarion/PHP template generates all necessary files under the target application directory in a directory named PHP. Go in that directory and copy everything to the directory on the web server where the application should reside. all you need to do to deploy the application is to create an Alias for the target directory and copy the files there. What do I need to do in order to see the icons and images generated by the Clarion/PHP templates? Create a directory for all images in the Apache root as follows: C:\Program Files\Apache Group\Apache2\htdocs\Images (Apache 2) or C:\Program Files\Apache Group\Apache\htdocs\Images (Apache 1) Next. . What this configuration. and in the PHP. this will be moved in a directory to the server where an Alias statement was created in the Apache configuration file.INI.

or it may instruct the browser to get another file. Other key tags include <TITLE>. They surround the word or paragraph the format applies to. Clarion/PHP does not require you to know a single thing about HTML. such as an image file. color. You can apply the various style sheets supplied to use the colors and font schemes you think look best. bullets. it’s using a table. which delivers the page title which appears in the caption bar. etc. for example. In general. Each HTML page is a combination of static text. to bold the word Clarion in the following sentence fragment. or you can have a designer or web master edit the appearance of the pages you produce. when the end user clicks one. or any sort of fancy layout of graphic elements. whose cells you can merge. we must quickly review the elements of HTML. thereby changing the fonts throughout all your documents. such as headers of different styles. size. If you wish to customize further. You can encode further styles in a separate file called a cascading style sheet. and generally come in pairs. and <p> which provides the beginning and end markers for a paragraph. . whenever you see a web page with newspaper style columns. This can store a preference for a certain font. To arrange the layout of text and pictures. <b>Clarion</b> stands out. Certain built in styles. or insert to easily. and display inside the page. The links provide access to another page. formatting tags.CLARION/PHP User’s Guide 51 HTML (Hypertext Markup Language) In order for us to introduce the PHP language. The formatting tags consist of codes enclosed in angle brackets. you can easily update the look of the site by editing the style sheet. When you create a standard style sheet and use its styles for all the text in the pages at your site. indented text. The second of the pair includes a forward slash to indicate it’s the ending format code. you can edit the style sheets. the HTML code would be: amongst database development tools. such as </b>. the most common method is to declare a table. The first of the pair is the code within the angle brackets. or the HTML code within the PHP pages you generate. such as <b> for bold. It’s easiest to think of a table as a flexible grid. and links which instruct the browser how to display the text. and numbered lists are available.

the SoftVelocity logo will appear centered below:</p> <p align="center"><img src="/images/SoftVelocityLogo240w. All work and no play makes Jack a dull boy. a small amount of body text.52 CLARION/PHP User’s Guide Here is a “bare minimum” HTML page.</p> <p>And finally. Every good boy deserves favor.mydomain.com/pages/another_page. and a text link to a page called “other page:” <html> <head> <title>This Appears in the Browser Caption Area</title> <meta http-equiv="Content-Type" content="text/html.htm">Click Here</a> provides a text link to another page. The quick brown fox jumped over the lazy dog. charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <h1>This is the Page Headline</h1> <p>This is some body text.GIF" width="240" height="127"></p> </body> </html> And here is that page as it appears in an HTML editor’s preview: . headline.</p> <p>The following text. consisting of a title. where it says <a href="http://www.

Chief among these are the getRequest. and double forward slashes define comments. which refer to the incoming http request. (String variables must be prepended with a “$” character. parameters and posted data (fill in form data) that your PHP page receives.CLARION/PHP User’s Guide 53 PHP Language The scripting language itself is derived from Microsoft Basic. Those developers used to Clarion/ASP will be pleased to hear that PHP is more structured. values in any submitted form. and ?> at the end. For example. such as the connection string. it provides for eight data types as opposed to the one supported by vbscript. the developer uses the method called getForm(“FillThisIn”). and the values are loaded from the text file. getForm and Print statements. Statements inside those tags must end with a semi colon character. used by Clarion/ASP. and the HTML page it posts in response. these store essential items not expected to change frequently. A global declaration script (YourAppNameappdata. Clarion programmers only need to write PHP should they wish to customize the behaviors in the generated web pages. the developer may use the statement Print($myvariable). To write a string out to the clients browser containing the contents of a variable. to retrieve the value that the end user typed in. For instance. .app) declares the equivalent of global static variables. if a form on the referring page contains a text box named FillThisIn. Perhaps more important for PHP than the basic language elements and statements are the built in classes and objects for page and component access. Curly braces define statement blocks. and the outgoing http response respectively: the URL. and more like an ordinary programming language than just a scripting language. Scripts are enclosed in tags: <?PHP at the top of the file. Individual variables which are unique to each user are maintained via _Session structures.

54 CLARION/PHP User’s Guide .

3: PHP Template Concepts Longtime Clarion developers used to working in the Clarion language may be startled to think of the Clarion application generator generating applications in another language. though developers have had the option of incorporating C. • • Clarion has been the “language of choice” for the applications it’s created. and application generator. utilizing the same elements: database dictionary. design-time interface.CLARION/PHP User’s Guide 55 Ch. as well as source code level customizations. Clarion/PHP creates Clarion type applications for browser clients/Apache servers. The application generator takes all the customizations and outputs source code files. and indeed. Clarion/PHP represents the first time the Clarion environment has been used to generate source code modules with no Clarion code targeted (as an option) for a nonWindows environment. Clarion has generated database applications on DOS. on non Microsoft platforms. Clarion/PHP provides a new option to deploy Clarion applications to browser-based users from public or high volume sites. How PHP Fits In with Clarion Clarion’s emphasis throughout its long history has been to provide “canned” application behaviors which developers tie together through series of prompts and wizards: • • The developer creates a database dictionary describing the data. The development environment further presents a design-time interface which provides for further application customization. and Modula-2 source code modules. which also holds various application options. The project system then compiles and links the resulting program. . Windows and IP platforms for nearly two decades. C++.

Flexible interaction with the specific form fields within the update form allowing. The processors consist of small. Rich support for images. which are particularly troublesome in PHP. • • • • • • • • . These require that the order of the components be preserved. for example. whether displayed from a database row or external file. along with options to allow viewing. allows “ownership” of rows by an individual user or group of users. null values. adding. A flexible security model which provides up to 100 different security levels per procedure. these templates contain comments so that the web designer understands what is and is not “editable.. a page from elsewhere in the site to link to a form and pre-fill one or more fields.56 CLARION/PHP User’s Guide What’s Special About Our PHP Code The PHP/ADODB code generated by the application generator is highly compact and efficient. editing or deleting data according to the level of the user.” The columns may be rearranged). an integral part of the security model. The developer may then specify that only that user or group may access that data. • “Processor Pages. making it possible to identify record(s) for use when called from other pages at the site not generated by Clarion/PHP. tight loops that smoothly handle difficult access issues such as column names with embedded spaces. link to an update form for a specific record from any other HTML page.php pages that Clarion/PHP generate for your procedures contain database access code that writes a record.” which complement each of the . Compact JavaScript functions provide for rapid client side validation. Automatic calls to login screens and user validation from within all pages using security. and type conversions. so that the proper security is in place even if the PHP page is called from a page not generated by Clarion/PHP. Customization support within the template interface which essentially allows the developer to place HTML/PHP code alongside the Clarion/PHP code without harming the generated code. and without risk of overwriting the customizations at generation time. yet features robust error checking. (Except the templates for the browse pages.e. “My Records” filtering. (i. Extremely flexible interaction with URL parameters.

and then automatically change the “look” whenever the site is updated. The first guideline makes it crucial that you store as much information about the business rules and control pre-formatting in the dictionary as possible. There is significantly less capability for customizing appearance.CLARION/PHP User’s Guide • 57 Extremely flexible layouts via HTML run-time templates which can help you change any layout beyond the many options already available through the template interface. Clarion/PHP completely separates the application logic from the interface. not to your . and positioning. The web designer may modify anything and everything. HTML controls are different than Windows application controls. behavior. The second implies you rely as much as possible on the global level options (via the dictionary and the Global PHP extension dialog) to set control behavior rather than on the window formatter. . and which allow you to “blend” the pages into an existing web using the same look and feel. The only information that Clarion/PHP will pick up from your WINDOW structures is the list of available controls. making it a simple matter to turn the interface over to a web designer without worry that the customization will break the app. • Interaction with Dictionary There are two guidelines to keep in mind when working with Clarion/PHP: • • The template looks to the dictionary for your application flow and pre-formatting. An enormous amount of flexibility via use of style sheets that work along with the PHP pages allowing you to define exactly the look you wish.app file. so long as he or she cuts and pastes the symbols (for example @TableNameFieldName@) for each element to its new location.

unlike Windows applications. To the end user. however. . For this reason. In much the same way that you can declare a field to be a procedure link to a child update form. you can declare another field to be a procedure link to a parent update form. developers will find that this is the HTML implementation of child browses on a form. PHP opens up additional navigational possibilities from within the browse. It’s therefore quite simple to go from browse to browse. For Clarion developers who in the past have stuck closely the templates. The “menu. You can conceivably create a table with four or five columns and ten or twenty rows and enable every single piece of data in the resulting “cells” to link to a form or browse in a parent or child table that is filtered by the value in the cell it was linked from. you’ll simply accept the default links to the update form from the browse. It’s up to the developer in conjunction with the web site administrator to provide for the proper ‘gateway” into the individual procedure pages that Clarion/PHP generates. In the case of browse-to-browse navigation. separating the child browse from the form allows for more efficient memory and network communications. etc). view its child browses. Likewise. The normal navigational direction in Clarion flow is from parent to child to child (edit a record. Clarion/PHP may seem to offer an overwhelming variety of new choices.” i. a completely different part of the site having nothing to do with the application. but instead is a simple convenience for the developer to use when testing. you cannot assume that “window 2” will only appear if the end user first did something with “window 1. Additionally. Clarion/PHP allows for navigation in the opposite direction. it will appear as a graphic that when clicked leads to an update form. the developer must decide which procedure must link to others.” That can only be managed in the broader context of your overall web site flow. Clarion/PHP provides an index page with a dropdown menu organized by procedure category. This will allow for hyperlinks to the appropriate related tables. view child browses. the requirement that each procedure be able to stand in isolation makes the concept of a “menu” problematical. the application you produce must also be. or even. double click the child. It’s important to remember that each procedure or page must be able to stand in isolation.58 CLARION/PHP User’s Guide Navigational Links in Clarion/PHP Because HTML is stateless. if you wish to implement the “browse/form/browse” paradigm that Clarion desktop applications implement by default. This is allowed through procedure links. which procedures must be accessible from “outside.” however. isn’t meant to be deployed. Be sure to define the “Must be in Table” option within the dictionary for all fields that have a file relation.. Implementing the links require a few mouse clicks. edit the child.e. Every page can stand alone.

you can load the runtime HTML template that Clarion/PHP produces in an HTML editor. each generated procedure will include a login routine. one control to a line. Access by the end user to any procedure page with security enabled will invoke a login screen. You may specify the types of control. and access level (an integer between 0 and 99).CLARION/PHP User’s Guide 59 Window and Control Formatting A key concept to understand when creating PHP applications is that HTML controls are different than Windows application controls. When you enable security on a global level. There is significantly less capability for customization and far less control over positioning. That template contains symbols (@TableNameColumnName@) that indicate where the data will “go. in Clarion/PHP we’ve accomplished an extraordinary amount of mimicry of control formatting and layout using HTML 4. selected coloring. Optionally. or control-specific cursors. For example. providing that any period of inactivity does not extend beyond a configurable timeout. despite these limitations. . however. The good news is. This leads us to a “good news and bad news” situation. and a number of options for appearance and behavior. Layouts are either horizontal. Once the user enters a successful login on one page. Security Levels Clarion/PHP provides for a straightforward yet highly flexible security scheme based on a pyramid of user/group access rights with up to 100 user levels. The login messages/instructions are configurable. they must log in again. we can’t provide for transparency. or vertical as in a form. as in a browse. password. however. the table may store the user name (either first and last names separately. can make for a very attractive page. or first and last combined). and an email address if not used for the user ID. The bad news is that because there’s no way to equate every single one of the properties in the dictionary control formatting options with HTML we can’t guarantee that everything will be perfect. Good use of style sheets. After the page is generated.” You can completely redesign the placement of everything on your forms by editing the runtime template. You may designate a table within the database to store a user ID (we suggest that an email address is highly useful for general public web applications). immediacy. and more dependent on selecting properties from lists. We can’t recreate controls such as regions. they may access any page their security level allows rights to.0 and stored it all in style sheets for maximum flexibility. Developers will find that your control formatting will be less visual. to name a few. If it does. but it’s not the same as designing a dialog box.

Each of the files is named *LG??. that no space should exist on either side of the = sign. Spanish. “EN” = English. . If you wish to customize the default prompts. once security is enabled. Use a dedicated relational DBMS for all but the smallest sites and for testing. which is designed for SQL. supervisors level 50. customize the messages further at either the global or procedure level.DBMS Requirements Clarion/PHP is designed to work with ADODB. “Next record” as a tool tip for the “Next” navigation button) are completely customizable. adding. All traffic between the browser and the server is unencrypted and therefore open to packet sniffers.60 CLARION/PHP User’s Guide After specifying that security is to be enabled. for example.TRN files in the Clarion template directory. edit the . you may effectively limit viewing and editing of data to only the members of that group. We’ve provided “sets” of messages in three languages: English. and if necessary. Additionally. Thus. the developer may separately specify separate access levels for viewing. which allows you to designate a column as that particular row’s “owner” allows you not only to provide for limiting access to the record only to an individual. and designating the table which holds the user information..g. Database Access . unless secure http (https) is used. is 1). implementing the global security table in conjunction with the “My Records” filtering. managers level 70 and senior managers level 90. should the developer specify that ordinary users are level 30. Deployment of https is beyond the scope of this manual and is a matter for the web administrator. The file format is template symbol=text. and the text string is unquoted. and “SP” = Spanish. Choose the language set in the global options. and deleted only by senior managers. The PHP code it produces has been tailored to be fast and scalable. a developer may specify that a particular form might be viewed all. a department ID as the owner. Note that no % sign precedes the template symbol. German and Dutch. With 100 possible values and four possible access levels per update form. but also to provide for security “groups. and is well suited for high volume sites. where ?? is a two letter abbreviation for a language. an existing record edited by managers and higher. Language Clarion/PHP’s default messages (e. French. editing.TRN. The database behind the application is of the utmost importance. the security system allows for many possible access scenarios. “FR” = French. and deleting data.” By designating. a new record added by supervisors and higher. Within each procedure. the developer may then set custom access levels by procedure (the default for all.

the “Tasks” example provides a quick and easy demonstration of significant functionality yet takes only a short time to complete.CLARION/PHP User’s Guide 61 Ch. Most specifically. . 4: Getting Started Exercises Our Annotated Examples PDF included with this product provides very detailed instructions for creating the sample applications. We suggest that you use these as a starting point for working with Clarion/PHP.

62 CLARION/PHP User’s Guide .

application. 5. . and place the server and logon information on the Connection Parameters tab. Please see the Global Options/Security Tab section for further information on security. Press the Global button in the Application Tree dialog. Open an existing application.CLARION/PHP User’s Guide 63 Ch. 4. there is only one tab which must be filled in when first applying the extension template: • Database Tab/Connection properties/Insert/Call Connection Builder Button: this displays the PHP DBConnection Builder dialog. Though all the tabs have important options. the web server cannot provide the ADODB libraries with the information necessary to access the data. Press the Extensions button in the Global Properties dialog. Press the Insert button in the Extension and Control Templates dialog. The “How-Tos” cover preparation. or create one with the application wizard. Application How-Tos Application of Global Template This section provides and overview and describes the essential/required steps involved in applying the Clarion/PHP global template. and Site Deployment/Integration. Select “PHP Global Template” in the Select Extension dialog. 2. 3. A more complete description is available in the Reference section of this document. These are all explained in the reference section of this document. The global extension prompts consist of eight tabs. In addition. the Security tab may be considered by many to be essential. To apply the Global Template: 1. testing. Without this information. Choose an access library on the DB Selection tab. 5: How-Tos The subsequent topics provide step-by-step directions for implementing Clarion/PHP for your business applications.

Press the Extensions button in the Procedure Properties dialog. To apply the PHP Browse template to a browse procedure: 1. Select the PHP Browse extension template from the Select Extension dialog. 3. When applying the browse extension template. verify the unique key on the HTML Table tab contains the correct key information. Please see the Browse Options section for further information on the PHP Browse template. Press the Insert button in the Extension and Control Templates dialog. Open the Procedure Properties dialog for the browse you wish.64 CLARION/PHP User’s Guide Application of Browse Template This section provides and overview and describes the essential steps involved in applying the Clarion/PHP browse template. 4. A more complete description is available in the Reference section of this document. . 2.

CLARION/PHP User’s Guide

65

Application of Form Template
This section provides and overview and describes the essential steps involved in applying the Clarion/PHP form template. A more complete description is available in the Reference section of this document. To apply the PHP Form template to a form procedure: 1. 2. 3. 4. Open the Procedure Properties dialog for the form you wish. Press the Extensions button in the Procedure Properties dialog. Press the Insert button in the Extension and Control Templates dialog. Select the PHP Form template from the Select Extension dialog.

You must verify that the Form Primary File and the Unique Key on the Data Access tab are filled in properly before you may save the form properties.

66

CLARION/PHP User’s Guide

Browse/Form/Browse or Query/Browse/Form
If you’ve used the default Clarion template set to create an existing application for which you wish to generate PHP pages, your application is probably in browse/form/browse format. By this we mean that the top level procedures browse a list of records, and the end user locates a record they wish to edit. The end user pulls up a form, and if it’s necessary to navigate further, either to select a value in a related table, or to browse a related table, another browse appears. In general, web based applications start with a query form, for privacy reasons and/or to reduce the amount of data to be passed to the client (downloading a 1000 item product list vs. typing in a product name). SoftVelocity has designed Clarion/PHP so that it works equally well starting out with a browse, query form, or for that matter, a form. In the latter case, you must either start with a blank insert form, or pass a unique ID to the page if it’s an update. You set the unique ID field in the Procedure Properties dialog, and identify it in the URL as “ID1.” Thus, for an order form, whose unique identifier is the order number such as 12345, to directly open a form containing the order, the linking URL should contain a parameter in the form http://YourPageURL?ID1=12345. Clarion/PHP does not pass the name of the field, because that might compromise security. Note that in case of a multiple component primary key, the parameter format, for a two component key, for example, is in the format ?ID1=12345&ID2=67890 In general, you do not need to adjust your application at all. Browses and update forms will be generated with the parameters (or lack of parameters) that you specify. It’s merely a matter of linking to the PHP page with the correct URL. The following are examples of the ways in which you can link to the PHP pages from either the top level contents page, from a frame, from any other pages (not produced by Clarion/PHP) at your site. You may combine as many of these access methods as you like. For the purposes of this example, the table is called “Products,” the procedure is called BrowseProducts (the table name figures into the page naming convention, e.g, the PHP file with the browse will be called /myapp/BrowseProductsList.php) a column containing unique values (strings) is called “Product_Name”, and a column containing duplicate values is called “Category.” Assume also that the category values are integers. Finally, assume that all URLs are encoded /myapp/filename.php. • Normal Browse (no filter other than that defined in the template procedure): this is the default, so no actions are necessary within the template interface. The link is simply /myapp/BrowseProductsList.php. Note: Microsoft Internet Information Server is case insensitive.)

CLARION/PHP User’s Guide •

67

Browse (with a range select on one field): in the PHP extension template for this procedure, locate the Product Name column on the Table Data Columns tab. Press the Properties button. On the Column Header tab, check the box labeled “allow calling this procedure with the value passed as a parameter.” You may then filter by value, simply providing a parameter called ID1, as in /myapp/BrowseProductsList.php?ID1=Potatoes. Note that Clarion/PHP automatically distinguishes between numeric or string parameters in the URL parameter.

Assume that you wish to see all the product names in category 1. The URL would be /myapp/BrowseProductsList.php?ID1=1. Note that the general http format for passing multiple parameters within a URL is ?parameter1=value&parameter2=value&parameter3=value. It’s important to note that you may only assign one field per browse table to filter the browse by ID1 parameter. If you also wish to filter by a single, different field, copy the procedure, rename the copy, and set the template option for the different field. If you wish to filter by multiple fields you may filter via a multiple component unique key, if one exists, or if not, a ?WHR parameter. To use a ?WHR parameter, the usage is http://mydomain/myapp/BrowseProductsList.php?WHR=dbo.products.price > 10. Bear in mind that this exposes your column names to the end user, who can see it in the address box of the browser. • • • Query by Form: no parameter is necessary from the calling page. The URL would be /myapp/UpdateProductsSearch.php Blank Update Form: no parameter is necessary from the calling page. The URL would be /myapp/UpdateProductsAdd.php. Update Form for a Specific Record: simply use the unique ID1 value as a parameter called “ID1.” Thus, to call an update form for the product named “Ford Model T Black,” form the URL with /myapp/UpdateProductsAdd.php?ID1=“Ford Model T Black.”

Link a Browse and Form
Linking to a form from a browse is done automatically when you apply the browse template (though you must also apply the form template to the form. But if you wish to do it manually, it requires specifying which column should be the hyperlink. Remember that unlike a desktop application, the HTML application cannot receive a double click, or a right click and then a menu option. Therefore, there must be a single click way to select a record and link to an update form. For each row, you will designate one column as that link. You can select more than one, but that could be confusing to the user.

68

CLARION/PHP User’s Guide You simply have to decide whether to use the text value for a specific field for that link (for example, click on a last name to update a personnel record), or to accept the default graphic link, so that the end user locates a row they desire to edit, they click on the pencil either at the left or right of that row.

In the Browse Procedure:
Providing for a text link requires the following steps. 1. On the parent browse, be sure the PHP browse extension template has been applied. Verify that the primary column and the unique key fields have been selected. On the Data Columns tab, select the column you wish to make the link and press the Properties button. On the Actions Tab in the Data Columns dialog choose Procedure Link in the Create Column as a Link dropdown list. Choose the Update procedure in the Procedure to Link dropdown list. Choose Edit from the Type of Procedure dropdown list. Save changes and regenerate.

2. 3. 4. 5. 6.

When the end user clicks on a value in the column you selected, an update form will appear.

In the Form Procedure
To complete the action from the form side, you merely have to verify that the parent browse was correctly identified, so that when the update action is complete it will return to the browse. (The only time that you should be concerned that the template may have misidentified the parent browse is in a highly customized window containing many browse control templates). 1. On the update procedure, be sure the PHP form extension template has been applied. Verify that the primary table and the unique key fields have been selected. On the Actions tab, verify that the parent browse procedure from the Parent Browse dropdown list is correct. On the Data Access tab, verify that the Primary Table and Unique Key are correctly identified. Save changes and regenerate.

2. 3. 4.

GIF file available. 7. Choose the Update procedure in the Procedure to Link dropdown list. 3. Choose Disk File from the Populate From dropdown list. On the parent browse. 4.” Choose the alignment and location for the picture column. On the browse procedure’s PHP extension template. 2. open to the Custom Controls tab. . A transparent background provides for flexibility in case you elect to change the table background color. Press the Image button to select an image to display.CLARION/PHP User’s Guide 69 Graphic Link From a Browse to a Form The following is the default generated by the template. 9. be sure to have a small transparent . to signal a link you’ll choose an external . This is a matter of taste. The placement will be either to the left or the right of the data columns. Verify that the primary column and the unique ID fields have been selected. 1. 6. be sure the PHP browse extension template has been applied. or to the /images directory of your web server). 8.GIF file. Use the file selector to choose the image file. Save changes and regenerate. Choose Procedure Link in the Create This Column as a Link group box. Choose Edit from the Type of Procedure dropdown list. 10. Insert a column. (Note that in most cases you will wish to copy the image either to the project\php\images directory. for example “Edit Record. Most likely. 5. calling it. if for some reason you wish to do it manually.

this also prevents users from querying unindexed columns. Simply use the field name and value as a calling parameter. Note: a read-only or view form is also available which allows the end user to view the data without allowing for editing.php?ID1=”a unique ID. • • A Query Page Clarion developers often use the Browse/Form/Browse paradigm as a convenient way to allow the end user to type a few keys to locate the record they wish to edit. or a deletion. which otherwise might slow the DBMS. through which they can proceed to a view or update form. The end user can type in a value or values. the URL should be /myapp/myprocedureEdit.” Don’t include the period! The unique ID is the value corresponding to the column which was identified in the extensions dialog as the unique column. Additionally. To link to an update form. unless you wish to add a new record.” Don’t include the period! Blank Update Form: no parameter is necessary from the calling page.” Delete Form for a Specific Record: exactly the same as update. an update form for a specific record. Providing a query page for this functionality is often a more useful strategy for Internet applications. in that it’s not necessary to download a page or table full of records in order to locate a specific record for editing. The calling URL is identical except that the page name ends in “View” instead of “Edit. it’s necessary only to supply a unique parameter for the record you want. By displaying the form. except for any fields you elect not to populate (by checking the Do Not Populate on QBF box on the form extension). and any matching records will be returned in a browse. There is no difference in calling an update or a delete (the record will be presented to confirm deletion). .” as in /myapp/myprocedureView. other than the name of the form to link to. in which case no parameter is necessary. To call an update form. the end user can type in an ID number or a few letters. The URL would be/myapp/myprocedureAdd.php.70 CLARION/PHP User’s Guide Form Without a Browse The steps to display the form vary according to whether you wish to link to a blank update form. Examples • Update Form for a Specific Record: simply choose the unique identifier and use a value as a calling parameter named ID. view a list of records that match the query. Note that in general.php?ID1=”a unique ID. except that the page name will be different. and then choose one for editing. The Query by Form will use the same form layout as the update form. the URL should be /myapp/myprocedureDel. the easier it is for the end user to use the query form.php?ID1=”a unique ID. To call an update form. the less fields on the query form.

the child records of which update to reflect the values dependent on the key record selected in the parent table. you must decide whether to link from a graphic. 71 Browse to Browse A Browse to Browse navigational link helps you provide a simulation of the parent/child browse functionality which Clarion so easily supports in desktop applications. be sure to have a small .” Choose the alignment and placement for the picture column. in this case the end user only sees the child browse when they click or link in from a selected row in the parent table.php. 3. or from a text value within a row of data. On the parent browse procedure’s PHP extension template. Then: 1. be sure that the Data Columns options for the linking field includes the “Range Limit on this column” option. . Leaving a check box unchecked is not equivalent no choice. On the parent browse. No parameter is necessary. calling it. Insert a column. might simply say “Show Orders.GIF displaying that particular text. Choose Procedure Link in the Create This Column as a Link group box. Verify that the primary column and the unique ID fields have been selected. or a button you’ve created as a . which is a check box option.GIF file available. 2. On the child browse. select the Custom Columns tab. static text. This is a matter of taste. A new table appears with the child records. for example.” whether the link be text. Choose List from the Type of Procedure dropdown list. link to /myapp/myprocedureSearch. To link to the query from an outside page. By segregating the browses into two separate windows. A navigational back button in the child table returns to the original parent browse. The placement will be either to the left or the right of the data. A transparent background provides for flexibility in case you elect to change the table background color. A browse to browse from customers to orders. The end user therefore clicks on a record in the parent table for which they wish to see the child detail. Using a Graphic to Signal the Link For a picture link. Much like navigating from a browse to an update form. Instead of providing two lists (or selects) in a single window. be sure the PHP browse extension template has been applied. for example “Orders.CLARION/PHP User’s Guide Note: an unchecked check box instructs the query to test the field for a FALSE value. 4. Clarion/PHP reduces the amount of communications necessary between the server and the browser.

The Child Side Finally. For example. and: 1. For example. On the Actions tab. Select the Data Columns tab. Select the name of the child browse procedure to link to from the Procedure to Link dropdown list and set the procedure to type “list. Be sure to place the image in the images directory. Open the PHP extension template on the child browse procedure. See “The Child Side. select Procedure Link in the Create this Column as Link group box. You still need to select an option on the child browse procedure. On the parent browse procedure’s PHP extension template.” below. by choosing from the dropdown list.” below. You still need to select an option on the child browse procedure. Set the Type of Procedure to List. 6. To make this type of link: 1. Select the column from which you wish to link and press Properties.” 2. range selected to display all the other products in that particular category. yet pass data from another column. a column called Category could link to a browse on the Categories table. you must provide for the target (or child) browse to be ready to receive a filter. open to the Data Columns tab. See “The Child Side. and press properties. CLARION/PHP User’s Guide Choose the Browse procedure for the Orders table in the Procedure to Link dropdown list and set the procedure to type “list. Choose the General tab in the Data Columns dialog. . 2. 3. 3. Linking from a Column Value You may also provide a link to a second browse from the values displayed in one of columns of the table rows. You could also specify that the link provide the value clicked on as a parameter to the target browse.72 5. Select the data column for the filter field. Note also that you can provide a link on one column. even from another table to the target procedure page.” Type in the name of the graphic in the Display Image box. so that it may then range select on the value. yet the end user sees and clicks on only the employee’s name (which indeed may come from another table in a normalized database). you may wish to pass an employee ID number. in a browse upon a product table.

If you forget to make a choice. Note that you may provide for a custom graphic for the lookup button should you wish.” 73 When all done. . you must regenerate the PHP code. the popup will disappear and the value will be returned to the entry box.CLARION/PHP User’s Guide 4. Select Browses Wherever you populate a field in a form for which you’ve placed the “Must be in Table” option on the child table in the Clarion dictionary a button leading to a select browse will be populated. Check the “Range Limit on This Column. the procedures dropdown list will default to the first browse in the application tree. To enable the Select Browse procedure. it is likely that the lookup button will display an entirely different browse in the popup. you must manually choose the proper select browse for all the “Must be in Table” columns which appear in the update form. one which moreover contains no “clickable” fields from which to choose a value. and when the end user chooses a value. A popup list appears when the end user presses the button.

Table Loaded Selects on Forms When an RI rule specifies that a value in a given field must reside in a related table. and another to provide the value to be written to the database. from the one of the sample applications. for example.” the company ID number for “XYZ” to the normalized database. while writing “12345. You may also specify one column for display. Clarion/PHP can automatically generate a dropdown list of those values for your update forms. and then must populate either a FileDrop or FileDropCombo control template in the window. In the illustration below. .74 CLARION/PHP User’s Guide You must also apply the browse extension template to the Select Browse procedure in order for Clarion/PHP to generate an PHP page for the select browse. The developer need only specify in the dictionary the “Must be in Table” option on the child table. “XYZ Corporation” in the list that the end user sees. an update form for the products table fills dropdown lists from the suppliers and categories tables. When applying. This is useful to display. the dropdown is open on the categories list: Experienced Clarion developers will immediately recognize this functionality from the File Drop Control Template. you will then specify which value(s) to return to the calling form. and which display field the end user will click on to indicate a choice.

and enter the following in the additional parameters box: &txtOrder_DetailsOrderID=" . Normally. which is what a list box is called in the HTML specification. however. You must concatenate a string with the control name plus a PHP statement to get the value from the record set. and you wish to pre-fill a new order details record with the OrderID. You can also specify a dynamic value. Note that this is very slightly tricky should you wish to use a function to pass a value. If your help is in a subdirectory below your php directory called help. Assume that you wish to call an add form for the Categories table. Within each of the procedures which you’ve Clarion/PHP enabled. plus the table name). “fields” retrieves the requested column. Help and Popup Windows Help authoring may be done via generated help file shells which include a “place your text here” area in which you may include your help text. You may use Notepad or an HTML editor.htm. Set the appropriate target procedure (probably UpdateOrder_Details). txtOrder_DetailsOrderID is the control name. " In the above example. The controls are all named in the format txtTableNameFieldName. and the $oRSOrders is the name of the record set (oRS." Simply enter txtCategoriesCategoryID=13 in the additional parameter box when declaring the procedure link. and prime the CategoryID field with the value "13. Assume that you're in an order record. The trim function trims any white spaces. and then a trailing unbalanced double quote. on the Page tab. trim($oRSOrders->fields["OrderID"]) . creating help files is not within the scope of this manual. Be sure to turn off HTML help generation in the Clarion/PHP template after customizing! You may also use an HTML authoring tool. leave the static text box blank. The txt simply stands for text. the simplest way to provide help is to create a separate HTML document containing the help text for each procedure. Simply place the name of the help file in the Help URL box. How to Prime a Field on an Update Form Should you wish to prime a field for an add form. This is the only way to prime a field for an add form. or Microsoft Word. as in a text control. to make up for the first string that you "closed" with a double quote earlier. In general. Should you place the help file in a separate directory. use the "additional parameter" box in the Controls dialog. and the column name is placed in square brackets. set it to pass static text. you’ll find a Help URL box. Then the trailing double quote is appended. use the relative path with slash delimiters. the help URL’s should be in the format “help/helpfilename.” . The add form expects URL parameters in the form of ?controlname=value.CLARION/PHP User’s Guide 75 In some cases it may be necessary to check the SQL statement generated for the select control.

g. you may wish to store all the help in one HTML file.. . Your HTML editor should allow you to insert anchor tags. You may then use anchors (e.76 CLARION/PHP User’s Guide Note that for a small PHP application. http://www.mydomain.htm#myanchor) to load the help page and jump to the section containing the appropriate help topic.tld/myhelppage.

The default start page provides a simple dropdown menu. either create a new directory below your web root and copy the files there. When you deploy to the public server. it displays the DBMS server name. you should not copy this page there. You may also edit the Apache configuration file. and tests that PHP/ADODB can correctly access the file system so that it can output pages via the runtime HTML templates. Never leave this page on a public server. please run the Utilities menu items. or edit the Apache configuration file. Procs. or whatever method is most convenient for your site. open the URL http://localhost/yourvirtualdirectorypath/procs. This will be the link in the menu just left to the Help. user ID and password. you should test this page first. then the web server is not working. you should install and test that Apache is running correctly on your local machine. If not. iterates through the tables. Any time you create a new application and testing on a local machine. address. you’ll copy all the files in the project\php directory and below to your web server. If using a local copy of Apache on a Windows system. If you absolutely must copy it. delete it immediately when you’ve finished testing. The Test Database item opens the ADODB connection used by your application. (Note: this assumes you’ve already generated the PHP pages after applying the PHP template to your project. . once you’ve generated an application. samba.htm.htm is a default “start page” that Clarion/PHP creates for your PHP procedure pages.CLARION/PHP User’s Guide 77 Testing How-To’s Testing on Your Local Machine If you have not already done so. • Loading the Test/Debug Page To test begin testing Clarion/PHP. or create a soft link from the web root to a directory residing somewhere else (just be sure that the apache user account has access). or you have additional file security implemented. the simplest method of enabling access to the application is to create a directory under the web root and copying the files there. Before clicking any of the procedure links on this page. via ftp. You’ll find instructions that will help you with this task in the Setup chapter of this manual • If not using a local copy of Apache. If it did not open a page. On the server. you’ll receive a “page not found” message).

begin testing the procedures. and verify that each step detailed in the document succeeded. load the page. but this is normal and only indicates that it is a filtered procedure and may require a parameter. Some may appear blank. Any problems documented in the last section indicate a security settings issue. see the Links on page 83 in this PDF. Any problems documented in the middle indicate a database connection problem specific to a table or view. . For more information regarding this. After a successful connection. In general • • • Any problems documented in the first section indicate a problem with your database connection settings.78 CLARION/PHP User’s Guide When testing locally for the first time. If any step failed. the document tells you the most probably causes. choose Edit > Find from your browser menu.

at the place you wish Clarion/PHP to insert the code it generates (i. privacy or other important statements. you should plan on copying your HTML template to your development machine. the place where you want your browses. You may use the tops and bottoms to provide a place for company logos. (Note: this is not to be confused with the project directory\php\html directory. There are two types. middle or bottom. One is a design time template. Because the Clarion/PHP data elements are of a reasonable size. This HTML file must reside in a directory called html. Use any standard HTML editor to create your template page. which is used every time an end user requests a page.CLARION/PHP User’s Guide 79 Integration/Deployment How-To’s HTML Template Though it may seem that everything is being called a template. they should fit well into a site with or without frames. and placed in-between the top of a page and the bottom of a page These “tops. The other is a run time template. which is used only at the code generation step. site navigation. forms.. to appear). place the text @Clarion/WEB@. This focuses only on the HTML templates. ad banners.” “bottoms.e. (Don’t type the period at the end of the sentence). Therefore. You or your web designer will without a doubt wish to create your own HTML design time template. including links to various Clarion/PHP generated procedures. You must create the directory and copy the file there.. Clarion templates and HTML templates are different things. You must type in the name of your template in the Global Options dialog for the PHP extension. or anything else.” and “sides” are your HTML design time template. be it top. all processed by the PHP module. which is an output directory). directly below your application project directory. etc. Clarion/PHP merges the data access elements into the pages it creates at the time you generate the pages. in the field called HTML Template. . • Design Time HTML Templates: all the PHP code that Clarion/PHP generates for data access is a combination of HTML and PHP pages and headers. At some point within the page.

Each token stands for the data which will replace the token. Style Sheets HTML style sheets. This allows any site to greatly change its look simply by substituting a new style sheet for an old one. these runtime templates are the setting for the individual data fields and prompts. etc. Each data field. and will be standardized in look and feel. and that page is then delivered to the end user. This therefore means that you may further customize the layouts at this level as well. You may include these in the HTML template. Bear in mind that these HTM files are regenerated. a table.80 CLARION/PHP User’s Guide Many sites use HTML includes to create standardized page sections. • Run Time HTML Templates: after you’ve chosen your template. . and so forth). cell in a table. the PHP code resolves the request for the data. Should you wish to modify the layout. You may not add or remove tokens. gets the data. Should your site subsequently modify its style sheet. etc. and that element will then be formatted according to the instructions in the style sheet. so that the Clarion/PHP pages will be as easily maintained as the rest of the site. opens the runtime HTML template. Clarion/PHP allows you to define styles for elements such as table column headers. when you first generate your application it produces additional HTML files for your other procedures. The style sheets declare classes. Note also that web designers may edit the style sheets using appropriate utilities or a text editor. and formatting choices of your site. which consist solely of formatting instructions. Turn off html generation at the procedure level should you wish to make changes and keep them. you may modify the html page. You can then apply the style to a tag (be it a paragraph. known as cascading style sheets (because one style may cascade its characteristics into another. You’ll find more information on Clarion/PHP’s use of style sheets in the chapter devoted to the style sheet editor. In the browse procedures. or element such as the navigation buttons has a symbol which appears in the runtime template. you may wish to set their options so that they mimic the color.). data rows. you will find tokens in the format @TablenameFieldname@ occupying the table. replaces each symbol with the appropriate prompt or data. When the end user requests a page. prompt. simply update your Clarion/PHP style sheet to match. play a large role in many sites. and a large role in the Clarion/PHP pages. When you create the style sheet. update form control labels (prompts). These are also editable. or set the file to read only. font. for example. In essence.

i. you already have a first name. respectively. for example. If in doubt. you’ll want to display a blank update form with those three fields pre-filled in. To do so. LastName and CustomerNumber would be txtCustomersFirstName. Thus. If. product ID’s etc. it’s a simple matter to look at the html code.php'>" In this case the “action” points to the next page that should appear after submitting the form.e. for a form using edit boxes.php?txtMyTableUserName=abcd &txtMyTableUserID=1234. your web administrator will need to post the data as URL parameters to the form fields on your Clarion/PHP update form. then the form control names for the fields FirstName. Then the other form simply provides a url such as http://domain/updateform. Simply change the file name in the action tab to a different page in order to post the form data to that page and display it to the end user. The formula for each form field name is txt + Table Name + Field Name. If the table were called Customers. The form tag includes a “target” which is the next page the end user “goes to” after pressing the Submit button. Each . txtCustomersLastName. Passing Data to Other Parts of Your Web In cooperation with your web administrator. customer ID’s. the web administrator will need to know how the form fields on the Clarion/PHP update form are named (their ID’s). last name and email address. . It’s a simple matter to change the form tag so that the action “targets” an existing or new page in your site.CLARION/PHP User’s Guide 81 Collected Data from Forms on Your Site It may be that other parts of your site already have forms which gather important data such as names.. This page also receives the POST data. naming the fields and forming the link properly. In order to do that. and you wish to allow the end user to create a new customer record without having to re-type that information.php file includes a form declaration. a line taken from one of the pages generated by Clarion/PHP below: FormDeclaration = "<form name='form1' id='form1' method='POST' action='BrowseviewContactsList. This manual assumes that if your existing web already uses HTML forms the web administrator is familiar with working with forms. you may optionally edit the generated Clarion/PHP files. what the end user filled out in the form on the previous page. and txtCustomersCustomerNumber.

The “otherpage. changing the action page is as simple as: FormDeclaration = "<form name='form1' id='form1' method='POST' action='/mysite/otherpage.82 CLARION/PHP User’s Guide In the above example. By referring to the Clarion/PHP produced HTML equivalent of the PHP page (in the html directory below the PHP page). If the table name is called Customers.php page. set the file property to Read Only using Explorer). . respectively. LastName and CustomerNumber would be txtCustomersFirstName. The formula for each form field name is the “$txt” + TableName + Field Name. then the field names for the fields FirstName. and txtCustomersCustomerNumber.php” may then process the posted data.php'>" (Note that the PHP page will be regenerated the next time you generate the project! When you must edit the . the web developer may easily view all the form field names. txtCustomersLastName. though the developer must inform the web administrator of the names of the form fields.

An important concept for database developers to grasp about PHP is that. There is no program flow like a desktop application. Note that though the procs.htm page generated by Clarion/PHP is not meant to be a table of contents for end users (it’s intentionally kept very plain). The field it refers to will be the unique ID field which you defined for the procedure extension. • • • • Links Links are the conduits through which one page leads to another on the Internet. The only limitation is a logical one: if you wish to display a form containing only one record. The parameter will always be called “ID1” (plus “ID2” if a multi component key). the browser and web server do not maintain a continuous connection (it’s stateless). it does provide a handy reference to the page names you may wish to link to from other parts of the web. Further. the following steps will be necessary: • Manage the look and feel so that the Clarion/PHP pages fit perfectly into the site. the links on the procs. Verify that security is adequate. . the files (ftp uploads. you must supply a way to identify the record(s) within the link. Correctly integrate links to and from various site pages and other applications (insofar as these are consistent with the rest of the site). like web pages. Test that at an operating system level. access to the database. or display a filtered browse. directory names. the web server and the database do not maintain a continuous connection per each user. For these developers. Verify that the server resources are adequate for the application.CLARION/PHP User’s Guide 83 Ch. 6: Integrating with Your Site It’s anticipated that most developers will use Clarion/PHP to produce a small number of data access enabled web pages to fit into existing sites. or from anywhere within the Clarion/PHP pages. For this reason.htm page generated by Clarion/PHP can be used from anywhere within the site. Its primary purpose is to provide the developer with a quick way of testing the Clarion/PHP generated pages. securities and permissions) are correct. You can do this as a simple HTML parameter. and may be easily maintained so that overall site updates will not leave them behind.

This is limited to a unique ID maintained by Apache for each user’s session. if you’re a developer thinking about program flow. plus the session variables that Clarion/PHP declares.php Blank Update Form: clarionupdateprocedurenameadd. queries the database. The only persistent data lingering from page to page are the application data and session variables. and worried that you’re leaving an open application behind if you jump from a browse to a completely different browse: there’s no need to worry. all that happens is that the session will eventually time out.84 CLARION/PHP User’s Guide Persistence of Data It’s important to understand that each time a Clarion/PHP page makes a request to the database for data. HTM Pages: (contain the elements in which the PHP pages place their data. and closes the connection object.php Update Form: clarionupdateprocedurenameedit. In fact. a user opens a browse. and closes the connection object.php Query Form: clarionupdateprocedurenamesearch.php Processor Pages: (contain the PHP code for database access) same names as above.htm. .php Delete Confirmation Form: clarionupdateprocedurenamedel.php Read Only Update (View) form: clarionupdateprocedurenameview. even if the user jumps from a browse to a completely different part of the site and never goes back to the application. it requires a few session variables and perhaps a cached result set on the web server. which solely reside on the web server. gets the data. receives a result set. but not all) same names as above. ending in x. Therefore. Leaving an application open does not waste a large amount of resources: at worst. PHP creates a connection object. sends some number of rows to the end user. When. you may change some layout characteristics by editing these pages. for example. Here are the main points to understand so that you can link into any part of the Clarion/PHP pages from inside or outside the pages: Page Naming Conventions • • • • • • • • Browse: clarionbrowseprocedurenamelist.php. ending in . Note also that you have control of the timeout value. PHP creates a new connection object.

php?ID1=1093">link text</A> • <A href="/path/clarionupdateprocedurenamedel. where the value is the value of the unique ID column. 85 Linking Conventions Reminder: to pass a parameter via URL append ?ID1=value to the URL. in which application specific tags specify to the layout editor what parts of the page are to be “editable. such as: Update form.php">link text</A> <A href="/path/clarionbrowseprocedurenamelist. such as: Query form: URL only. new blank record: URL only. In the examples below. Note that “link text” is the text that the end user sees and clicks on to arrive at the page.” you will have no problem adapting these templates. no filter: URL only. view a specific record: URL plus unique field value as parameter. In general.php">link text</A> <A href="/path/clarionupdateprocedurenameadd. and the layout tool then allows you to (essentially) “fill in the blanks” with the text and images specific to that page. filtered: URL plus unique field value as parameter. we’re assuming links relative to the root of your site. .CLARION/PHP User’s Guide • Finally.php?ID1=1093">link text</A> Site Standard Page Format If you already use a standard HTML template (in the sense of a template used by layout tools such as DreamWeaver. delete a specific record: URL plus unique field value as parameter. differences in capitalization will lead to a broken link. update a specific record: URL plus unique field value as parameter.” and “sides” of the page. such as: Update form. • • • • • Browse. such as: Update form.” “bottom.php?ID1=1093">link text</A> <A href="/path/clarionupdateprocedurenamesearch. such as: <A href="/path/clarionbrowseprocedurenamelist. such templates provide the “top.php?ID1=1093">link text</A> • <A href="/path/clarionupdateprocedurenameview. such as: Browse.php">link text</A> <A href="/path/clarionupdateprocedurenameadd. please note that *nix servers are case sensitive. such as: Update form.

Then in the Global Extensions. insert the symbol @Clarion/WEB@ in the spot where the template normally places the “fill in” text. declare the page as your design time template. With apologies to the very popular site whose page was “borrowed” for the example below. At generation time. All that you need do is open the template. and save an HTML file to the project\HTML directory. this represents what happens when you take an existing page and place the @Clarion/WEB@ symbol inside it. all Clarion/PHP generated elements will appear in the place in which you put the symbol. Note that the colors in the style sheet were designed to mimic those in another table found at the site: . we call this a design time template.86 CLARION/PHP User’s Guide In Clarion/PHP.

access method.CLARION/PHP User’s Guide 87 Ch. It also allows you to specify debug mode. which you must write separately. and security of the database. 7: PHP Template Reference PHP Global Template Options The template options in the global extension dialog allow you to define the look and feel of all the pages generated for your procedures. .. of course). Fill in the template prompts on each of the tabs in the global template dialog. and to define the location. using HTML templates and style sheets. It provides access to dialogs that allow you to customize all the prompts and messages (except for the help text pages. Global Options/Global Tab The global tab allows you to set the look and feel for the generated pages.

should you change a global option afterwards. You may enter the following tool tips: • • Help Link: default text is “Help. To choose a set of prompts.88 CLARION/PHP User’s Guide Because all the messages are set in the template. Tooltips Clarion/PHP generates ALT text for its button images.” “French. it makes it simple for you to customize your applications for specific languages. If you wish to customize the default prompts. and “SP” = Spanish. edit the . Note that no % sign precedes the template symbol. of course. such as “Add a record. the global change will not affect any of the options in the changed procedure. You may override your global options at the procedure level. You must. indicate the help page address in the individual pages’ template options should you elect not to use the auto-generated names. Spanish and French. Typically. where ?? is a two letter abbreviation for a language. “FR” = French.” You may override all these messages at the procedure level. Each of the files is named *_LG??. select “English.” Back Button: default text is “Back.TRN files in the Clarion template directory. of course) are provided in English. and the text string is unquoted. Note that when you check the option to override in a procedure. that no space should exist on either side of the = sign.TRN. The format is template symbol=text. “EN” = English. Target Language All default Clarion/PHP help and prompt messages (not including the prompts in your dictionary and application files.” or Spanish from this dropdown list. which are displayed as tool tips in Internet Explorer (ALT text only displays in other browser if the image is missing). Show Help Button Providing a help link specifies that individual pages should display a hypertext link to a help page. these messages are basic instructions.” .

g. message pages. By storing this information in a single file. and requires 5.0 (Cascading Style Sheet. Clarion/PHP makes use of the CSS 1. You should think of Clarion/PHP as responsible for generating only the data elements and/or data access related messages. etc. that is a CSS 2. An HTML style sheet is not unlike a word processor style sheet: it contains style names. This is convenient. desktop background) for an item. weight and color.. not in the category of the other four. and then indicating the style for a given paragraph inside all the documents at the site. and help. form. HTML Design Time Templates All the data controls generated by Clarion/PHP will appear within a page you specify.CLARION/PHP User’s Guide 89 Global Options/Cascading Style Sheets These buttons allow you to create the cascading style sheets for use in the web pages created for your procedures. You can specify separate style sheets for each type of page: global. and your HTML design time template to provide a setting in which these elements appear. ..0 feature. Please see the following chapter. list. “Style Sheet Editor” for instructions on customizing your style sheet. The Clarion/PHP elements are not limited to the top or bottom. the administrator gains the ability to change a style sheet and change the look of all the text within the site. size. as defined by the W3C) specification except for one feature: should you elect to specify a local Windows color setting (e. and other elements below. for example. Note that the global choice applies to any pages such as the index. each of which contains information about the font face.x browsers and higher. directly below your application project directory. This HTML file must reside in a directory called HTML. for placing a navigation bar at top.

You may use different templates for different types of procedures: list (browse). any choices not filled in). forms. Note that you may override the default template at the procedure level. place the text @Clarion/PHP@. You may specify separate templates for browse lists. and enter your preferences in the dialog. whether to place a navigation bar in the list. etc. .90 CLARION/PHP User’s Guide Use any standard HTML editor to create your template page(s). index page. navigation bar options. (Don’t type the period at the end of the sentence). global (all others). Press the button and enter the file name for your template(s). at the place you wish Clarion/PHP to insert the code it generates (i. Press the button to display the dialog.e. be it top. List Defaults The list defaults set the global options for the amount of rows to show in the list boxes. the place where you want your browses. select browse lists. forms. and tool tips related to list boxes.. form (update). and all others (help. to appear). At some point within the page.. middle or bottom.

The default is 16. the only communication is with the web server and the web browser. Therefore. You may specify custom images for the navigation buttons on the Images tab. allowing the end user to easily view the next page of the browse. You may enter the following tool tips for the navigation buttons: • • • • • • First Page Prior Page Next Page Last Page Add Button Query by Form Button .” Place Database Navigation Bar on List Pages PHP creates navigation icons similar to the Clarion application toolbars. no further communication between the web server and database is necessary. Automatically Create Detail Link This option automatically adds a graphic at the end of each row of each browse box providing for a link to an update form for that row.CLARION/PHP User’s Guide 91 Data Records per HTML List The value you specify for Data Records per HTML List sets the maximum number of rows which you wish to appear within the HTML tables which will represent your browse boxes. when pressing the “PageDown” or “PageUp” buttons. which are displayed as tool tips in Internet Explorer (ALT text only displays in other browser if the image is missing). Note that the normal mode of operation (see Cursor Location. Navigation Button Tool Tips Clarion/PHP generates ALT text for its button images. When checked. You may also specify a custom image for the “button. below) is for the web server to cache the result set from the database. This provides for a very fast means of browsing the database as perceived by the end user. you may specify that the update be either view only (View) or edit.

Show Add Button on DB Navigation Bar Use this checkbox to enable or disable adding records from the browse. if the browse is already limited to products in category 13.92 CLARION/PHP User’s Guide Note that the browses are page loaded. and the end user type “T” into the locator box. No Records Found Message This allows you to specify the message text the end user sees if the user chooses a browse for which no rows are returned by the database. each page will display as many records as you set in the Data Records per HTML List box. . When the end user types in a value. the end user must click on this link. the locator is on product name. Show Query By Form Button on Database Navigation Bar This provides a fast. and specify the tooltip text. it adds a LIKE% clause to the current where clause.” This message also appears following a query submitted via a search form. The default text is “All Data. Clear Filter Prompt Should you choose to populate a locator control in your table.” If the end user wishes to return to the previous list/query. In addition to checking the box. above. or queries it but no data matching the query exists. this provides the link text for the end user to clear the filter. The locator acts as a query limiter. enter the tool tip text for the button. The end user merely has to fill in the data to search for in a page arranged in the same layout as an update form. the results returned will be only those products in category 13 starting with “T. efficient means of locating a record in a large database. tied to a specific field. Thus. Note: you’ll specify the query form within each browse properties dialog.

therefore. with which the end user can select a specific date. the button will display a popup calendar.CLARION/PHP User’s Guide 93 Form Defaults Button The form defaults set the text for the tool tips and message text related to forms. the user may press a button to view the next or previous record. This checkbox allows you to disable the feature. The default is checked. Enable JavaScript Calendar Popup This will automatically place an ellipsis button next to all your date fields. plus allows you to specify whether to allow popup calendar entry for date fields. . When pressed. Clarion/PHP automatically provides “back” and “forward” buttons to navigate through the table in the key order specified by the parent browse. When viewing a single record update form. Uncheck the box to disable the calendar and choose a default date format from the dropdown list. Enable DB Navigation on View Forms When displaying a view only update form.

You may also define a custom message to display when the end user presses the next or previous button after reaching the last or first rows. This text box sets the text for the list box selection signifying “any value. By default. this text displays a “None” option. type in the character in the “indicator value” box. But when displaying a a list within a search form. and choose the “indicator location” using the dropdown list. Search Mode Select Control Text If you’ve populated your update form with a list box.” Form Button Text Tab . To customize.e. you may optionally include you may optionally place an asterisk (commonly used) or other character after either the field prompt or the control.” The default text is “None. in order to allow the user to specify no value (instead of a single value). check or uncheck the “display indicator” checkbox.94 CLARION/PHP User’s Guide Additionally.” and “Next Record. you may specify the tool tip for the next and previous buttons by typing it in.” respectively. i. no choice was made for the query for this field. When adding a record in which a “Must Be In List” validity option was checked. respectively. that list box appears on the search form (unless you specify otherwise). Clarion/PHP provides for an asterisk following the prompt label. The default text is “Previous Record. Required Field Indicator To indicate a required field. the list properly defaults to the first item in the list..

Return to List from Search: a navigational aid. insert. You may specify separate titles for each update mode. which will appear to the end user in a message page should the condition described in the list below apply: • • • • • • Status Text: a label before the text that describes the current process to the end user (i. Record Not Found: a ID field for the form did not match a row in the database. and for the tool tip text (using ALT). Enter your preferred text for the Submit.e. Delete. delete. edit. Form Message Text Tab These boxes allow you to enter custom text. and Edit buttons and their respective tool tips.CLARION/PHP User’s Guide 95 These allow you to specify text for the form buttons. . view and search.. i. Reset. Insert Failed: ADO was unable to add a new record. Insert Succeeded: a new record was added.. te word “Status” in “Status: Updating a record”. both for the button text. Form Button Titles Tab These allow you to specify text for the page titles (which appear in the caption bar of the browser). Return to List: a navigational aid.e.

The default strings are “Required Field. or in-list validation.” “Numeric Field.96 • • • • • CLARION/PHP User’s Guide Update Failed: ADO was unable to edit and save a value in an existing record.” or “Must be in List. You may specify the text for required.. Delete Confirmation: asks the end user if they’re sure they wish to go ahead with a deletion. Delete Failed: ADO was unable to delete a record as requested. . Update Succeeded: ADO was able to edit and save a previously existing record. numeric. we suggest that your replacement message be as short as possible.” respectively. Form Validation Text Tab This tab allows you to specify a short message that will appear in the status bar for any fields on an update form for which client side validation is set up. Delete Succeeded: ADO was able to delete a record as requested. Should you wish to override the defaults.

. which the template code merely passes on. Enable Debug Mode Debug mode specifies that the pages generated should be for debug purposes. Be sure to choose this option only during development. this is simply because PHP provides a great deal of information. and whether the resulting PHP pages should enable debug mode. and to turn it off before deployment due to the possibility of a security risk because of extra information in the HTML source sent to the browser.CLARION/PHP User’s Guide 97 Global Options/Generation Tab The options on the Generation tab allow you to optionally specify and control the additional non-PHP pages be generated when the Generate All command is executed. Developers who have previously worked with Clarion/PHP may be surprised to find that the debug information generated by Clarion/PHP is more comprehensive.

php pages that Clarion/PHP produces corresponds to a procedure. Clarion/PHP passes all Apache. the end user may (1) click a button. if you copied a sheet produced by another project.htm page. Set the Height and Width in pixels by typing values in these boxes. HTML pages and Help skeleton pages. PHP and/or ADO errors through to the page. an end user can fill in an entry with a value from a related table by clicking on a button. When the end user presses the help button. More importantly. viewing the related table (which displays whatever fields the developer includes. HTML Pages: each of the . not just the one with the specific value). To fill in a customer ID field. The developer may set the Height and Width in pixels of the window. When the window closes the customer’s ID appears in the entry box. which pops up by typing the values in these boxes. Popup Select Window Size In a select browse procedure.98 CLARION/PHP User’s Guide In debug mode. (2) locate a customer by name in a popup window which then appears. Popup Help Window Size Clarion/PHP generates help document templates for each procedure and places a help button in your procedure pages. You may edit the • . (3) click on the customer name.php code with the HTML layout placed in the corresponding . The .php pages each require a corresponding . Suppress File Generation The three components besides PHP that are produced by Clarion/PHP are the style sheet.php page merges the logic from the . You may enable or suppress these pages using these controls. merges the two of those into the HTML template (usually providing just a top and bottom part of the page). Note also that the Test/Debug page described in the Testing on Your Local Machine section is also an efficient means of testing the critical parts of your PHP application. Note that because the style sheet options are template symbols stored in the . for example.php page places there. Clarion/PHP attempts to provide a “friendly” explanation. and finally links the style sheet to format all the text and input objects throughout. you will not have access to the settings from that sheet through the Clarion/PHP style sheet editor. you will wish to turn off style sheet generation so as not to overwrite that style sheet with a blank one. the help window sizes to the values you set in the template interface. In non-debug mode. which you manually copied to your project’s project\php\styles directory. • Style Sheet (CSS): suppressing cascading style sheet generation is useful when using a style sheet created in a previous application.app file. The .htm page which provides a “setting” for the controls and data that the .

htm pages to custom format or change the layout of control elements. simply open a page in a text editor and type your text in the line that says. which appear when the end user presses the help button. SQL String Delimiter: should your database require it. • . Though your data structures continue to take their definitions from the data dictionary. suppress help page generation so that the next time you generate the project you do not overwrite your customizations.CLARION/PHP User’s Guide 99 . • Help Pages: Clarion/PHP automatically generates skeleton pages for your help text. the actual connection information resides in the global extension settings maintained in this tab. Additionally. To add your text to the help pages. After editing. the General sub-tab allows you to specify database specific SQL generation options. you may specify the double quote character instead of the default single quote character for delimiting string values.” For large blocks of text with complicated formatting and/or illustrations. Once you’ve created the help files. suppress HTML Pages generation so that the next time you generate the project you do not overwrite your customizations. Global Options/Database Tab The database tab helps you define the connection settings for the ADODB connection from the web server to the database server. and JavaScript functions to automatically size the popup windows. we recommend loading the skeleton help files into an HTML editor. Miscellaneous Box • Using Access Database: checking this box (Windows servers only) specifies that Clarion/PHP should generate non-standard SQL for use with the Microsoft Jet Engine. These pages contain formatting according to your style sheet options. “Customize your help text here.

runtime user ID. or password. insert for creating a connection object and press the Call Connection Builder button. There is no means to display a dialog to retrieve the values from the end user at runtime. password. you may specify double quote or pound sign characters instead of the default single quote character to delimit data values. you’ll press the Connection properties button. and other connection parameters. The connection string simply tells PHP which ADODB library it must use to access the database. Without them.100 • CLARION/PHP User’s Guide SQL Date Delimiter: should your database require it. which provides prompts for the runtime user name. Note that because Clarion/PHP supports both Windows and *nix servers. To specify these settings. Your PHP application will not function if you omit the connection string. Connection Information box PHP depends on your application providing a connection string. This will display the PHP DBConnection Builder dialog. the server will not be able to access the DBMS. plus a list so that you may choose the proper ADODB library. plus any necessary options for that database. . the lists which allow you to specify the target libraries display a legend to help “remind” you which target libraries are supported on which platforms. You will use the connection builder to build the connection string.

CLARION/PHP User’s Guide 101 PHP DBConnection Builder Dialog This dialog contains two tabs. . check only Unix and Native Client DLL. The DB Selection tab is straightforward: simply pick a database from the list. check Windows and all three of the “layer” check boxes. As you look through the choices in the list itself. If your Apache target is Windows. if your target is *nix. then you will very possibly use them. The following note provides additional information: • Use the checkboxes at the top of the dialog to filter the choices in the list. and the second allows you to enter the server/login parameters. and have no need to view those choices. then you do not wish to use ODBC or ADO. The first selects the database type and database access method. If your target is Windows. If your Apache target is *nix. you’ll note that “X” marks each column’s support or not for that particular target OS or access method. Remember that ADODB is cross platform. In general.

we recommend using Clarion/ASP and IIS/ASP to connect to that database. if you wish to use ADO. which provides transaction support with mysql. These are usually not installed as defaults by most Linux distributions. Runtime User Name: enter a user ID which PHP will use to log into the database. ODBC support in for Apache/PHP/ADODB/Windows is good. choose mysql. If you must use Apache/PHP. The functionality of ADO to MS SQL Server is limited. we suggest using the native dblib.102 • CLARION/PHP User’s Guide Note that for normal mysql support. In general. • • • Server/DNS: enter the name of the server on which the DBMS resides. the ADODB libraries automatically manage all ADO options. Runtime User Password: enter a password which PHP will use to log into the database. Note that for ADO support (Windows target only). not mysqld. • • • Connection Parameters: This tab allows you to input the specific server and login information necessary to access the database chosen on the DB Selection tab. you’re probably better off using the Clarion/ASP product. however note that this option does not support unicode data types.” such as InnoDB. The latter is for mysql installations using non default “types. you will instead enter the DSN. If targeting Windows/ODBC. .

and assumes a database table consisting of user names and security levels. Upon login. in order to check the user/password tables which are stored in the database. This may be a digit up to 100. Clarion/PHP checks the user name and password against this table. as per the description of the DSN options. Clarion/PHP must have access to the database first. The end user does not have access to the runtime user/password.CLARION/PHP User’s Guide 103 Note: This password is different than the security built into Clarion/PHP. The fields on the Security tab are as follows. By assigning users from the same department the same access level number. above. upon a request by the user. if you’ve specified that an access level of 75 is necessary in order to change the value in a form. you may mimic to some extent the use of security groups. Within the browses and forms on your site. Another column stores the access level. the PHP code will compare the users access level ID to the options you’ve specified in the template. Global Options/Security Tab The security model built into Clarion/PHP is user based. • Database: enter the name of the database to be used by your application. Thus. Note that the ellipsis buttons next to each field allow you to select a column/field from the dictionary as appropriate: . It is flexible enough to allow up to two columns to store the user name. anyone with an access level below that will simply see the form as read-only.

. the fields below will be enabled. A password column and a security level column should also be included. User Security Level Column Select the name of the column containing an integer between 0 and 99 containing this value. User Table Select the name of the table within your database containing the security information. Unique ID Column Select the name of the primary key column. This may be used to store a user name. User E-Mail Column Select the name of the column containing this information. All fields should be character fields. Data Connection This dropdown control allows you to select the connection object used for the security tables. User Name Column Select the name of the column containing this information. except the user password column. When checked.104 CLARION/PHP User’s Guide Provide User Based Security Check this box to enable security. set as a primary key. and should contain at least the following structure: one of FullName/FirstName + LastName/Email Address. or another unique key. Login Password Column Select the name of the column containing the password. Login Name Column Select the name of the column containing the database login name. E-Mail is only a suggested column.

to set the database server up with proper security. that should the end user’s browser security settings prevent the ability of your site to store cookies that the cookie will not be created. you may edit the login. Check the “Allow saving user identifier as cookie” box for to store the user ID. No option is provided in the design time interface to change the expiration time. The default text is “Save Information. so that no one is able to browse this table. of course. Be sure. and optionally. Clarion/PHP allows you to store the user ID/password in a cookie. allowing you to save variables locally. or both the user ID and password. You may also set the text for a message which prompts the end user to decide whether to store the information or not. so that the end user. this is (more or less) a standard. and is not visible to the browser. .CLARION/PHP User’s Guide 105 If the user name is in two columns… This allows for FILE structures containing separate columns for first and last names. of course. for retrieval the next time the end user logs visits your site. Login Persistence/Cookies Cookies are ASCII files stored on the local drive of the end user. the “allow saving password as cookie” for the password. can automatically login without having to type the user ID and password. You may store the user ID only. Note that the PHP code generated containing these items remains on the Apache server at all times. Additionally. if this necessary for your site. please note that the user name and password are stored as plain text within the cookie file.php page (search for the string “mydate”). The default expiration time for the cookie is December 31st of the current year.” Note. whenever logging into your application from the same machine in which they stored a cookie previously.

Fill in the following text: • • • • • • • • Login Prompt Text: (self explanatory) Instructions: text to explain the login procedure Bad User ID: text to notify the user that the login failed Bad Password: text to notify the user that the login failed Insufficient Access: text to notify the user his security level is lower than that required for the page they requested Enter Retry: text to instruct the user how to retry the login Submit and Reset button labels: (self explanatory) User ID and Password prompts: labels for the text boxes in which the end user enters the information. plus the messages to display should the login be unsuccessful. .106 CLARION/PHP User’s Guide Login Screen Text This button opens a dialog box which allows you to enter the text for your user login pages.

Be sure to configure an email client on the IIS server. The former is installed along with the latter. Email ADO Errors—Administrator Email Allows you to optionally specify that errors and logs are forwarded to the email address you specify.CLARION/PHP User’s Guide 107 Global Options/Administration Tab The Administration tab provides global options for the pages you create. . Site Title Fill in a string that you wish to appear in the top frame of the Clarion/PHP generated index page. Note that this also requires the CDONTS library and the MS SMTP service on the web server.

then PHP may not receive back an error message. If the database operation simply times out. which can often be the case. To do so. and then an entirely different error message appears over which you have no control. “A Database error has occurred and the administrator has been notified. The information reported is as follows: • • • • • • • • • • • • Server Name Server Port Web Server Software IP Address User Host Address PHP Script File Name Script URL Query String Parameters Referring Page Local IP Address Fully Qualified PHP Script File Name . Enhanced ADODB Error Reporting You may choose to provide additional to the end user in case of error should you feel it is useful. Then the application will appear to freeze until the timeout is reached. The default error message states. Thank you.” The ADO error details will then be appended below that. check the box on this tab. Note that this error displays only if the PHP library reports back an ADO error.108 CLARION/PHP User’s Guide Message to Display on ADO Error You may specify a custom error message to display to the end user should the application receives an ADO error.

To change the default. Note that several buttons provide for two images: one enabled. else your “buttons” and other images will not display.CLARION/PHP User’s Guide 109 Images The Images tab allows you to define the location of the various button images which will appear in your pages. one disabled. change the default. The web server must be able to find this directory. the first thing to check is that the correct directory is named. If you don’t wish to use “/images” as the image location. A reminder: when running on *nix. If your pages are missing “button” images. and the second thing to check is the case of the file names. . all file and directory names are case sensitive. be sure to copy them to its /images directory. Be sure to copy the files to whatever directory you indicate. the images are expected to be stored one level below the site root directory. Image Relative Path By default. The labels for the template prompts for these images are self explanatory. See the section called “Internet Service Options/Creating the /Images Virtual Directory” for instructions on creating your /images directory on your “localhost” web server. simply type a new directory name into the box. in a directory called /images. When deploying to your production server. Be sure to copy the Clarion/PHP images to the /images directory should you not be using /Clarion6/images/php as your default.

. When you define a variable name. you are responsible for adding the symbol name (in the format @symbolname@) to any HTML runtime template that you wish to display the variable. If they are different sizes. select the variable in the list and press the Properties button. AppGen will automatically declare the variable at run time. and type the name of the variable into the User Data dialog. We suggest prefacing any user-defined variables with a distinct preface.” in order to distinguish them within the generated code. enter zero and zero. feel free to locate the button image you wish. Once you define a variable. Image Type Tabs Because there are many images. Please refer to the chapter on Embeds for information on embed points and PHP. You may enter the width and height in pixels here. such as “ud_.php page. User Data This tab allows you to define user variables for use in embedded code.gif or .jpg images. and Clarion/PHP will generate the symbol into the runtime template. these are divided into: • • • • • Navigation Help Sort Indicators Database Navigation Calendar Should you wish to substitute your own . It is the developer’s responsibility to put the symbol to use. in the appdata. or pressing the ellipsis button to browse for an alternate file. It is to your advantage to enter the pixel widths. press Insert. Note: the back and help buttons are not affected by this parameter. To edit a variable name. Don’t forget to copy your custom images to the images directory on the web server. To delete a variable. You may also specify a border size in pixels for the images.110 CLARION/PHP User’s Guide Image Sizes It’s assumed that all your navigation and help icon images will be the same size. else the browser client may redraw the table after completing the entire download. To add a variable. select it and press delete. and change the file name by either typing a new file name. Or you may optionally name a custom control with the same name as the variable.

we’ve provided a separate chapter to explain the process and its usage. Please refer to chapter 9 in this manual for further information. Because this is a somewhat advanced topic. .CLARION/PHP User’s Guide 111 Includes Includes allow you to specify external files which will be merged into the document at the time the end user requests it.

It can be a local HTML page. etc. which was originally obtained from http://www.dhtmlcentral. In each menu item. you have the available options: Omit Item Check this box to instruct the template to not generate a link to this item when this page is generated. Edit. open the Procedure Properties dialog for the Frame. The PHP Frame Extension template provides the following options: Generate Test Menu Item Check this box to instruct the template to generate a test menu. press Insert. Overwrite Procedure Call .js styles\coolmenu4. or any valid URL address. . you also have the option to navigate to an alternative web page that you designate here.com/projects/coolmenus/ To add the Clarion PHP Frame extension template to the Frame procedure. You must omit them as described below. locate the PHP Frame template and press Select. Generate Only Used Items Check this box to instruct the template to only generate menu items for procedures that include any PHP extension. You can control which PHP enabled procedures you need to launch.js php\coolmenu4.) are not affected by this option. On the subsequent dialog.112 CLARION/PHP User’s Guide The PHP Frame Extension Template The PHP Frame Extension Template allows you to create a starting menu page to use with your PHP applications. and press the Extensions button. identical to the Utilities menu found in the generated procs. This will allow you to test the database connection from this generated HTML page.htm php\Main_Menu.htm file. there is a PHP Options button available on the Actions tab when this extension is populated. In the Select Extension dialog. Keep in mind that the base menu items in the Frame (File.Hyperlink to this page If this menu item is enabled.js JavaScript and associated style sheet is generated by the template. Help.CSS The coolmenu4. and also create additional menu items to hyperlink to other web pages! This extension creates the following files: php\index.

you change a global option. If. on the following tabs: Browse Options/Globals Tab You may override the global options for an individual browse procedure by checking the Override box in the browse procedure. no further changes you make to a global option will affect the procedure. In the Select Extension dialog. Important: once you check the override box for any procedure. locate the PHP Browse template and press Select. By default. open the Procedure Properties dialog for the browse. the templates provide “greenbar” formatting for browse tables. you may specify a greenbar effect or conditional row formatting on this tab.CLARION/PHP User’s Guide 113 The PHP Browse Extension Template Because the PHP templates do not assume that you wish to create pages for all the procedures in your application. The PHP Browse Extension template provides the following options. Among the settings you can override are the following: • • • • • • • • • • Style Sheet HTML and Help file generation HTML Template Showing a Help Link Number of Rows to Show in the Browse Table Include an Add Button in the Navigation Bar Include a Query by Form Button in the Navigation Bar Include an Automatic Detail Link in Each Row of the Browse. press Insert. This is in order to prevent the system from overwriting any of your custom settings. Security Navigation button “tool tips” . you must remember to execute the same change on every overridden procedure. therefore. and mean to change the setting for every procedure. To add the Clarion PHP Browse extension template to a browse. and press the Extensions button. you must manually apply the proper procedure template to those procedures for which you wish to generate PHP pages. Additionally.

by overriding the global security option you may add ‘My Records” functionality. the row is set to one style if it meets the condition. choose the same style sheet selected in the global options. and then select the style sheet for the procedure. When set. except Includes. Press the Row Style button and then fill in the following options to provide the desired behavior: • Default Row Style: select one of the Data Row Style Options you previously defined in the Style Sheet as the default row formatting. but keep the other global style sheet settings. as explained below. Default refers to the formatting for the odd rows should you choose a greenbar option. Security: the “Enable security for this procedure” checkbox option allows you to turn security off for this procedure. • Row Style: to specify conditional row formatting. See the chapter on the Style Sheet Editor. you must check the override global settings checkbox for the procedure.” below). Additionally. for which you may refer to chapter 9. and rows not meeting the condition will be formatted with another row style option. If you only wish to provide conditional formatting. Note that the checkbox is only available if you’ve turned security on at the global level. Before you can set conditional row formatting options. press the Row Style button (see “Conditional Row Formatting. • Conditional Row Formatting Conditional row formatting allows you to specify either that alternating rows will be formatted with two row style options you previously specified in the Style Sheet’s option for data rows.114 • • Status Messages Includes CLARION/PHP User’s Guide Please see the Global Options section for specific explanations of the above options. Note: you must already have defined at least two data row styles using the Style Sheet editor to specify conditional row formatting. and another if it does not. or. or the rows . that rows meeting a condition you specify in this dialog will be formatted with one row style option.

delete. Greenbar. without condition. Value: enter the value for the comparison. search and view form procedures limit their scope to the users’ records. The general process is as follows: • At login the end user uniquely identifies themselves. because many sites have adopted the email address as a common identifier. Operator: choose an operator for the test from less than or equal to. it’s unique to each person and easy to remember). The options appear in a drop down list. UserEmail is used. “Greenbar” specifies that you wish to alternately format rows using two styles (and neither has to be green). • • • . and for “My Records” access to individual data records: My Records The Clarion/PHP “My Records” support allows you to specify ownership of records by user. or Conditional. In a browse procedure. this is done without showing the field on the form. select one of the fields in the browse to test. • • • • Browse Options/Global Tab/Security Sub Tab This tab contains options for security level access to the entire procedure. not equal to. • Use Additional Row Style: select either No. equal to. This will format either the even rows (greenbar style) or the rows that meet the condition. or greater than or equal to. Additional Row Style: select the “other” row style.CLARION/PHP User’s Guide 115 that don’t meet the condition if you choose conditional. by choosing from the drop down list. Each user then views and edits only those records for which they have ownership. This is stored in a session variable (usually. Conditional selects one or the other row style dependent upon a field value. chosen below. Column to Test: when specifying a conditional option. one of the table columns receives the session variable (email). When the user adds a record to a “My Records” update procedure. ‘No” indicates that you wish to use the row style selected above for all rows. a filter is placed on all records limiting the rows viewed to those with the email (or other session variable) in that particular column. Similarly.

web sites use an email address as a unique identifier. and then using the “UserID” session variable to test against the “reports to” column.116 CLARION/PHP User’s Guide To enable all this functionality. You may use the “My Records” variable to flexibly filter records. To enable ‘My Records” filtering. as in the following examples: • The Northwind sample database’s employee table contains a “reports to” column. you’ll simply pick the UserEmail session variable. Similarly. Therefore in many cases. check the Override box on the Browse Options Globals tab. You could similarly substitute “region. else they will not appear within any users’ “My Records” filter. Note that should you be applying the functionality to existing data and are adding a column to a table that you must add the values necessary for the existing records. such as “Department. 2. but by type of user (allowing for access by group). You may filter a browse which allows “managers” to see only their “direct reports” by specifying the “reports to” column as the data column to compare.” etc. the employee ID as the user ID. you may declare an additional session variable. Check the Enable “My Records” filtering box. and then fill in the Security sub tab. Select the session variable to test against it.” edit the login. • Once you’ve correctly set up the “My Records” options for each procedure.php page to assign the session variable based upon department data which you would store in the security table. You may name the columns whatever you wish. you need do no more. Check the Enable Security for this Procedure box. and using the employee table as the security table. first turn security on globally. Then. When you design the database. and takes care of setting the data defaults for new records. be sure to provide that your master security table and any tables you wish to provide “My Records” support for all include a field of the same data type and length which you will use for these purposes. Clarion/PHP’s global level security dialog. You must enable “My Records” support on a procedure-by-procedure basis (both browses and forms). 4. . This column should be present in the browse procedure’s primary table.” “sales territory. to enable “My Records” on a browse. In many cases. as described in the following section. not only by user. as described step by step: 1. Clarion/PHP automatically hides the necessary fields. and then choose that session variable to compare to a department value in your primary browse table. applies the necessary query filters. you need not specify the same name for the column in every table for which it appears. 3. Select the data column which is to store the user information to test against.

e. could be useful for sales personnel allowing only an owner to see the account details. This means that you may allow an end user to view all records within a browse. deleting. i. due to the fact that each “procedure” within Clarion/PHP is isolated from the other due to the nature of the web. the page is then accessible to the user. Please refer to the previous sections in this manual which deal with Security for an overview of the topic. note that you may place “My Records” on a form yet not place it on a browse. or viewing details to each owner by placing the “My Records” filter on the form.CLARION/PHP User’s Guide 117 Finally. Browse Options/Page Tab . whether the end user may view the data within the browse. If the user meets or exceeds the requirement. The options on the Security tab at the form level provide further control for subsequent options. but restrict editing. but allowing everyone else to see an account summary. for example. Note that this setting controls the display of the page in its entirety.. whether the end user will be allowed to call an update form from the browse. Security Level Required to Access Page Specifying a level requires typing a number (1 – 99) which will then be checked against the user database (as specified in the Global options). This. as an example.

.e. You must produce the help text using an HTML editor. Help URL This specifies the name of the help page. additional options will appear. a list of records which should appear in a popup window. The popup help window sizing is specified in the global options. Add Procedure Specifies the update procedure for the record. a value should be returned to the calling procedure (not necessarily the same field as that selected by the end user. Note that this assumes the page is located in a directory called help one level below the PHP page. press the Insert button to specify the column to fill from. After the selection. and once the dialog opens. Press the button to open the Column Assignments dialog.. i. is clicked upon Column Assignments: this button leads to a dialog which allows you to specify which column values to return to the calling procedure and in what order. This allows the end user to see a familiar form. Select Mode Procedure Check to indicate that this browse is a select browse. the end user will view a browse containing records that match the query. view or edit an individual record by selecting from the browse. and can then. and the target column (in the calling procedure).118 CLARION/PHP User’s Guide Page Title This allows you to specify the name of the page. as it will appear in the caption bar of the browser. if you’ve provided a link to a form within that browse. i. but possibly another column of the same row). and of which the end user should select a single record.e. The help text appears in a popup window when the end user presses the help button in the browse. • • Column to Use as Hyperlink: receives the end user choice. . QBF Procedure Select an update form in the application tree to provide a basis to lay out the QBF form. and enter the data to search for in the form. After filling in a QBF procedure. Choose from the dropdown list. When checked.

however. you must customize the SQL statement (see below). . You may set the range select from the “update side. Clarion/PHP allows you to select a browse that may include fields from more than one table. This will call the select browse with a WHERE limiting the browse to only those rows in which the column matches the current value of the field on the update form. and a field on the select browse. Browse Options/HTML Table Tab This tab controls the overall functionality of the HTML table which will contain your browse data. No action is necessary in the “browse side” of the template interface. Remember that the template limits you to the display of a single browse. See the instructions for the Update/Controls/Validation tab.CLARION/PHP User’s Guide 119 Select browses can be called with an optional range select or a ?WHR clause. If not. and verify that the syntax is correct for that particular database. It will automatically generate the proper JOIN syntax necessary. examine the SQL select statement. it’s easy to provide a link to a separate browse. Note: if when debugging your application a browse composed of fields from multiple tables creates an error. but browses from single tables do not. Must be in File option.” by selecting a field on the update form. The dropdown list displays the FEQ’s (Field Equates) of any browse boxes it finds. copy and paste it into an SQL command line tool provided by your database vendor. Populated From This specifies the browse control within the window contained in the procedure.

For Clarion developers familiar with standard Clarion locators. an SQL statement with a WHERE fieldname LIKE ‘whatevertheusertypes%’ is sent to the database. The resulting records are only records that match the new query. This is useful for quickly applying a filter to a browse. When the value is entered. The % is a wildcard which includes any characters to the right side of what the user types. . This box will default to the key in the dictionary with the primary attribute. List Box Primary Table This allows you to select the primary file selected for the browse control. and the Locate button pushed. please note that this is very different. to quickly see all the names starting with a specific letter or combination of letters. for example. and then browse backwards from it. which allows the end user to type in a value and re-query the database. or past the end of those records that satisfy the filter. This is particularly helpful in allowing a user. Unique Key This allows you to select a key to uniquely identify each record. The end user cannot jump to the first record.120 CLARION/PHP User’s Guide HTML Table Title This box allows you to specify a string to appear at the top of the HTML table containing the browse data. Populate an Entry Locator This specifies that Clarion/PHP should generate a text box which shall appear above the table. If you pick a key allowing duplicate values. the procedure will return with a “not found” message.

calling the search results page from outside the Clarion/PHP pages. If. note that the browse must have a Locator specified for the field named.” The resulting search page will include a link back to the previous browse. the search clause will take the form ‘where searchfield like WhatTheUserTypes%’ which means that if the end user types in ‘A. therefore if your browse includes a default where clause or other filter. . for example.CLARION/PHP User’s Guide 121 To un-apply the query filter. Locator Column This allows you to specify a search column by choosing a field from a list. • • Final Note: should you wish to duplicate the functionality of an end user search. There are four items to note: • • For best performance.” The resulting page will include any previous filter that was in effect for the page prior to the search.” and the search was for “CompanyName like ‘A%’” then the search page results will be for “State = ‘NY’ and CompanyName like ‘A%’. the search column should be a key component. The default text is “All Data. Note that if the end user types additional text in the locator box when a query is active. the original browse page included a filter such as “State = ‘NY’. you may use parameters: BrowsePageURL?Locate=TRUE&Field=FieldName&SearchValue=SearchValue" In the example above.’ Any end user searches will append an SQL where clause to the clause which populated the browse. the new query will be applied only against the results of the previous query. In the case of a string search. the end user may press the “All Data” link which appears in the caption area whenever a query filter is active.’ then the search will return all values beginning with the letter ‘A. You may specify the precise text that the end user sees for this link (the Clear Filter Prompt on the Messages tab of the Global and/or Page Overrides). it’s recommended that you change the text. or an index should exist. After returning from the locate query. the browse will reflect the query that existed before the end user typed anything in the locator box.

should they wish to check the generated SQL. Regenerate SQL Should you insert or delete any of the columns on the Table Columns Tab (below). however. should you wish. then add or delete a column from the list. that should you edit the SQL by hand. the template will regenerate the SQL for the browse select only after closing and reopening the Procedure Properties dialog. This also provides a convenient way to customize a browse filter (the Where clause) or ordering. Clarion/PHP will not change your hand-edited SQL. . Clarion/PHP allows you to view the Select statement and customize it if necessary.122 CLARION/PHP User’s Guide Browse Options/Default SQL Tab Because the SQL to access the data is vitally important. or press the regenerate button (and then re-do your customization). you must either change your SQL statement by hand. Note. Some developers therefore may wish to immediately press the Regenerate SQL button after making a change to the table column list.

which is concatenated to the other parts of the statement. choose the list box formatter. After saving the list box and window changes. Should you find a statement with a blank for the field name (look for an extra comma in the order that the suspect field appears in the data columns list. open the window formatter.CLARION/PHP User’s Guide 123 Default SQL Select This text box provides the base select statement. If the column does not appear in the list box. Default SQL Order by The text in this box provides the Order clause. choose the related table.fieldname. press the add column button. if you’ve populated a data variable in the list box control for your browse). Those controls initially auto populated correspond to the list box columns in the browse box which you selected as the “Populated From” choice on the HTML Table Tab. You must do so manually if need be.). it will not be available from this list. and press the select button. the new column will be available in the list. Important: because it’s possible that the developer may customize the WHERE clause. which is concatenated to the Select statement. To insert a column. then the column. Default SQL Where The text in this box provides the Where clause. right click the list box. examine the SQL statement here. and their properties. click on the table select the column..fieldname. you may edit the statement here. Clarion/PHP automatically writes the correct JOIN clause in the SQL statement. or delete the suspect column from the list. the “Regenerate SQL” button does NOT erase this box. Browse Options/Data Columns Tab The table columns tab allows you both to specify which columns should appear within the browse. press the insert button. Note that should your browse contain fields from more than a single table.. If the column is from another table. should you have more than three JOINs.. for example. click on the table. Important Note: if you’ve populated a field in the Data Columns tab for which Clarion/PHP can’t resolve the proper syntax (for example. press the insert button and choose a column from the list. as in Select fieldname. Such a problem should be very rare. To insert it into the list box. and the resulting page doesn’t display properly. it will automatically provide for a JOIN. .

which is nbsp.124 CLARION/PHP User’s Guide In general. populating a browse table with many. many fields is liable to result in very narrow columns. to place two fields together with a space between them. compromising readability of the data. Therefore. Place an HTML <br> tag in-between the fields to provide this “stacking” effect. including the semi colon. which results in less time waiting for network transfers and a more readable page. and the page may be opened in view only mode. Clarion/PHP makes it easy to provide a view link. in effect making a cell into a multi line element. remember that these are HTML tables. so that the end user needs only to click once in order to see a page containing an update form. Moreover. it may be more helpful to limit the number of columns in a browse. group a column with the data from a previous column. When serving data over the Internet. Place the HTML code for a non breaking space. You can. however. not list boxes with horizontal scrolling capability as in a desktop application. disallowing changes to the data. you should approach the inclusion of data in PHP browse tables more conservatively than desktop applications. than including many columns. showing all or most fields. .

note what we think may become a common error for experienced Clarion programmers: when adding a date column. state. the nbsp. title. do not include the date component of the Clarion group which the dictionary import procedure automatically places over the date/time field. Use the date/time field.CLARION/PHP User’s Guide The illustration below contains multi-line data for the “Company” column. The SQL date/time field should by default not have the _DATE appended to it. . and address line 1. 125 Additionally. keyword precedes the last name. The <BR> tag precedes the first name. All fields following “company” were specified as grouped with the previous field. The Data Columns Properties dialog allows you to specify both appearance and functionality for the data in your PHP browse columns. A simple way to detect this is to scan the data columns list for any column named columnname_DATE. The dialog is divided into tabs. and should have a picture of @s8. and zip code fields. and city fields. since the import automatically appends the _DATE at import to the Clarion date field.

from the parent browse. and not display a particular field. Note that the first part of the URL is double quoted. You may separate the values via HTML entered in the “Preceding Text” box. and to use a value parameter to pass a value as a range limiter. The browse will then display only those records which match the filter.126 CLARION/PHP User’s Guide Data Columns/General Tab This tab allows you to hide a column yet still include it in the SQL statement. enter &nbsp. Include With Prior Column: this allows you to place two or more values within the same “cell. passing the value of the current row of the current field (for example.htm?ID1=” . You may also create the same functionality a different way.com/browsepagename. This allows you to match the functionality of a Clarion parent/child linked browse box combination in PHP (spread across two pages). . such as Where columnname = parameter value.” If one value is null. You can also easily create a browse to browse link. • • Checking this box will allow you this browse to be called with a range limit/filter. Request(“Customer_ID”)). and to provide that the browse can be called with a range limiter. (including the semi colon) which indicates a non-breaking white space. as in. for example. To insert a space between the values.php?ID1=’Smith’. (see the “Appearance” tab. You must only select this option for one column only. you may check this box. To enable such a link. check this box in the child browse. Range Limit on the Column: should you wish to call the browse from elsewhere within the application or from elsewhere within your site. for which you wish to display only a last name from the second table. then the other values will still be displayed. Include in the SQL Select But Do Not Display: there may be situations in which you wish to provide a custom SQL select statement. “http://www. by specifying that your field be a procedure link. Once the child browse is configured with the range limit option. Be sure to check this box for only one column. choosing the other browse procedure. be sure to provide the ID1 parameter. and include the field value as a parameter to this page. but not within the displayed data. When calling the browse. • • Data Column: the field name as it appears in your dictionary. and specifying List for the type of procedure. passing the value of the range limiting field. below). you may also call it from any other page on the site by passing the ?ID1= parameter with a range limit value. a browse populated from two tables: you may wish an ID number common to both tables to be present in the SQL statement. as in http://mysite/mybrowse.mydomain. add a custom link on the table data columns or static columns tab.

To enable the link to open an update procedure (or another procedure. or to add. for that matter). you must manually edit the Where clause on the Default SQL tab. it might also delete any customize SQL you had previously placed in the Where clause as well.CLARION/PHP User’s Guide 127 Once you’ve added this option. as in the case of opening up a browse on a child file. and then later uncheck it. check the “Procedure Link” box and specify the name of the procedure from the dropdown list. or delete a record. Data Columns Properties/Actions Tab The Hyperlink group box allows you to specify that when the end user clicks on a data item in this column. or to list data. Indicate in the second dropdown box the action to apply to the procedure: whether it’s to view data only. If the template were to clear the clause. the browser will open another page. Should you check this option. Remember to apply the PHP form procedure to the procedure you select. you must insure that all calls to the browse page include the ?ID1 parameter. edit. .

For example. This can be combined with hiding the Product ID in the browse. check the “Procedure Link” box and specify the name of the procedure from the dropdown list. but to pass the product ID as a parameter to a product update form. for that matter). Your choice will enable one of the following four controls. Session Variable. which means that you may specify custom tags such as Flash files. Data Column to Pass: allows you to define a link on one column. add. Indicate in the second dropdown box the action to apply to the procedure: whether it’s to view data only. You have complete control of the link. choose Key Value. or Static Entry (text). or JavaScript link in the Custom Link edit box below.” Pass this Data: allows you to define which value to pass. If not a link. or delete a record. or to list data.128 CLARION/PHP User’s Guide The Custom Link choice allows you to add an HTML or JavaScript link in the Custom Link edit box below. PHP. or delete). or to add. Additional Parameters: allows you to pass additional parameters when specifying a procedure link with static entry. • • • • • • • • • . from the <A> to the </A> tag. Custom Link: allows you to add an HTML. Fill in the format parametername=value. or parametername1=value1&parametername2=value2. or <a href="URL"><img src="Image. You must provide the text of the complete link. you must manually place it. yet pass a link value from another. Key to Pass: allows you to define which key to pass the value(s) of. Procedure Link: to enable the link to open an update procedure (or another procedure.GIF"></a> • Create column as a Link: optionally specify the link type (procedure or custom). This allows you to link to a form on a table with a multi component key. Static Entry: allows you to pass a string to a procedure. Remember to apply the PHP form procedure to the procedure you select. making the operation “friendlier” to the end user. edit. as in the case of opening up a browse on a child file. Data Column. to allow an end user to click on a product name. edit. as in. Type of Procedure: specify the type of Clarion/PHP the target procedure is (list. <a href="URL">Link Text</a>. view. Session Variable to Pass: allows you to define a session variable to pass to a procedure. The default choice is “No. The link will also not automatically display your data. the table merely displays the data as static.

below. In general. Please see the section on custom columns. as in: mylink = “<a href=’/HomePageContent. for further information on creating the actual link text for data columns acting as custom links.CLARION/PHP User’s Guide Your code must include the <a> and </a> tags.htm’>this is some text</a>” 129 When using a custom link for the data column. rather than at the left or right of the table. and therefore will be surrounded with double quotes. the only reason to use a custom link for a data column instead of creating a custom column (see below) is if you must include a custom link in between columns. The code surrounding yours enclose it with double quotes. . the value of the data column does not appear in the browse table unless you place it there manually. It’s important to note that the text you enter in this box will be temporarily stored in a string variable.

good DBMS management suggests that it’s best to remove the “sort” capability from columns not part of any key components or for which there’s little rationale for allowing a sort. Enable Sorting by this Column: allows the end user to click on an image on the column header to sort the column. but in general. Note that the default is sortable for all columns. • . Ascending/Descending Sort SQL boxes: the template automatically includes ORDER BY clauses (one for ascending.130 CLARION/PHP User’s Guide Data Columns/Properties/Column Sorting Tab • • Column Header Text: the text you wish to appear at the top of the column. one for descending) in the text boxes below. Note that you may manually override the default by typing in your own clause.

the browser’s rendering engine will adjust the column size as necessary. Width: this allows you to set a custom width (in pixels or percent) for this column. Data Columns/Properties/Appearance Tab • • Alignment: because all data in the HTML form is a string. center and right.CLARION/PHP User’s Guide • 131 Ascending/Descending Sort Images: the image files used to add a directional icon for the sorts. the cell alignment options are left. Bear in mind that should the totals for all the columns exceed either 100% or the available space in pixels. .

chosen below. Note that you must have previously defined more than one Data Row Style in the Style Sheet Editor to display a contrast between this cell and others.e. Operator: choose an operator for the test from less than or equal to. For each choice. you may specify conditional formatting by style for columns.. because it’s not designed to display field data. The options appear in a drop down list. or even values in the same column above or below it. in effect allowing you to highlight specific grid cells based on the data value. currency signs. equal to. Additional Row Style: select the “other” style. • • • • • • Browse Options/Custom Columns Tab This tab allows for similar functionality to the table columns tab. pick a style and specify the condition. No field chooser drop down list appears. Simply check the box. not equal to. which could then link to a child browse. Use Additional Cell Style: select Conditional. As an example. etc. an options tab will appear offering specific formatting options. make the value bold. number. etc. You may make the visual differences as subtle or as overt as you wish. to display a small graphic to link to another procedure. You may format a date/time. except that it does not display row/value data. Value: enter the value for the comparison. The custom columns are useful. for example.132 • CLARION/PHP User’s Guide Formatting Function: In the same way that you may specify conditional formatting by style for rows. a value in this column that meets certain conditions may optionally use a different style than other columns. Default Cell Style: select one of the Data Row Style Options you previously defined in the Style Sheet as the default row formatting. In this way you may highlight a particular value with a red background. an ellipsis button in a parent browse can be added on this tab. Column to Test: when specifying a conditional option. . such as decimal places. • Enable Cell Style: check this box to enable conditional formatting for this cell (i. immediately above this text. by choosing from the drop down list. select one of the fields in the browse to test. Conditional selects one or the other style dependent upon a field value. The options are self-explanatory. This will format the cells that meet the condition. as explained in the Table Columns Properties section. ‘No” indicates that you wish to use a single style. or greater than or equal to. or percent. within when the table grid appears in the end user’s browser. currency.

CLARION/PHP User’s Guide 133 Likewise. This automatic population may be overridden on the browse procedure’s overrides tab. For example. Properties. By default. the custom column deleted. and pass a product ID as a parameter. This places a graphic at the end of the row. such as a link to create a blank email message in the end user’s email client. by option) for the selected row. Clarion/PHP automatically populates one custom column. and edit the columns’ properties via the Custom Columns properties dialog. Or. the static column could provide a graphic containing any other type of custom link. or delete static columns from the list box.com?subject= some subject). the custom column could contain a graphic which might link to a page at the site which was not generated by Clarion/PHP. filling in the subject line (mailto:myemailaddress@mysite. or edit. or Delete button to add. Use the Insert. edit. when you populate a browse. which the end user may click on to view an update form (view only by default. you might use a shopping cart graphic to link to a shopping cart page. detailed below: . and afterwards. the Automatic Detail Link.

Location: the static column(s) must always appear either to the left of.” To enable the link to open an update procedure (or another procedure. or the right of your data columns. The default choice is “No.134 CLARION/PHP User’s Guide Custom Columns Properties/Appearance Tab • • • • Column Name: merely provides a convenient way to reference this column. Create this Column as Link: this group box allows you to specify that when the end user clicks on an item in this column. check the “Procedure Link” box and specify the name of the procedure from the dropdown list. the browser will open another page. . Alignment: right or left align the cell. for that matter). Choose one. Remember to apply the PHP form procedure to the procedure you select.

You are responsible for everything including the <A> to the </A> tags for this link. passing the value of the current row of the current field (in the following example. and reference session and data variables using JavaScript functions. or to list data. just remember where the quotes will be. If your custom link is (1) string only. and then don’t close the following quote: “ . Or.htm?parametername=” . “mystring If your custom link is (4) a function only. for example. you must watch your concatenation.mydomain. MyFunction(param) . • Hyperlink: allows you to add an HTML or JavaScript link in the Custom Link edit box below. You may concatenate strings and JavaScript functions. Request(“ID”)).htm?parametername=value. and therefore will be surrounded with double quotes.com/page. concatenate your function.” character in PHP).” such as “http://www. or to add. concatenate your function. just type your string and not worry about the quotes: MyString If your custom link is (2) a string with a function concatenated behind. and then open the following quote: Mystring” . called “ID. as in the case of opening up a browse on a child file. It’s important to note that the text you enter in this box will be temporarily stored in and PHP string variable. . edit. MyFunction(param) .mydomain. MyFunction(param) .CLARION/PHP User’s Guide 135 Indicate in the second dropdown box the action to apply to the procedure: whether it’s to view data only. “ If you have several elements. such as http://www. You may provide. you may include field data as a parameter. or delete a record. and then close the following quote: “ . concatenate your function (using a “. don’t forget to close the opening quote. Note that the first part of the URL is double quoted.com/page. an HTML parameter. Note that the custom link capability is useful for more than just linking to a static HTML page. don’t forget to close the opening quote.” If your custom link is (3) a function with a string concatenated behind. don’t forget to close the opening quote. The code surrounding yours will appear with yours as: mylink = “YourText/CodeGoesHere” This means that if you mix string and functions.

Remember that the file name must be either relative to the application’s web directory. specify the unique ID column for that table.mydomain. allows the DBA to store the images in a table separate from the table used for the browse. Note that the custom link capability is useful for more than just linking to a static HTML page. ID Value Column: if the Populate From option points to an image stored in the database. they serve as very nearly a way to place embedded PHP code in your applications. specify the column containing the image. If you’ve chosen to display an image in this column.htm?ID1=value. To reference a data element in the current form.136 CLARION/PHP User’s Guide To reference a session variable.php). such as http://www. for example. passing the value of the current row of the current field. Because the custom link options are almost completely free form. use the getSession function (from the generated utils. or to the web root directory. trim($oRSviewContacts->fields["EditSupplier"]) . You may provide. symbolizing a link to an update form. specify the file name. ID Column: if the Populate From option points to an image stored in a separate table in the database.com/page.GIF' border=0> </A> • Image Button: press to provide details for displaying an image in this cell. The following example shows concatenating strings and PHP code to make a dynamic URL incorporating the data from each cell as a parameter: <A HREF=UpdateSuppliersView. you may include field data as a parameter. you must fill out Image dialog after pressing the button: • Populate From: specify whether the image resides as an external file or a binary column in the database. Note that Clarion/PHP has tested binary images stored in the MS SQL Server database. You may use text functions to trim and insure against returning a null variable. Or. Table With Image: if the Populate From option points to an image stored in the database. "> <IMG alt='Supplier Details' src='/images/supplierdetail32x32. • • • • • . an HTML parameter. as in: trim($oRStablename->fields["fieldname"]). An example use of a static image might be a small pencil image. File Name: if the Populate From option points to an external file.php?ID1=" . Making this a separate option. specify the unique ID column for the row. Image Column: if the Populate From option points to an image stored in the database. specify the column containing the binary image data. when selecting either a procedure or custom link. use a php code to return it from the recordset: $oRStablename->fields["fieldname"].

called Column Header allows you to place a column text label at the top of the column in which the images will appear. • Column Header Text: the text which should appear at the top of this column. . 137 An additional tab. gif or png.CLARION/PHP User’s Guide • Image Type: if the Populate From option points to an image stored in the database. specify jpg.

press Insert. no further changes you make to a global option will affect the procedure. The application of the PHPbrowse template to a browse. The PHP Form Extension template provides the following options. and mean to change the setting for every procedure. open the Procedure Properties dialog for the form. because the PHP templates do not assume that you wish to create pages for all the procedures in your application. however.138 CLARION/PHP User’s Guide The PHP Form Extension Template As noted previously. To add the Clarion PHPform extension template to an update procedure. locate the WEB Form template and press Select. you must remember to execute the same change on every overridden procedure. This is in order to prevent the system from overwriting any of your custom settings. In the Select Extension dialog. you must manually apply the proper procedure template to those procedures for which you wish to generate PHP pages. therefore. Important: once you check the override box for any procedure. will automatically build in a link to the update form for that browse. you change a global option. If. You must separately apply the PHPform template to the update form. . on the following tabs: Form Options/Global Overrides You may override the global options for an individual form procedure by checking the Override box in the browse procedure. and press the Extensions button.

” a message such as “Due to a database error your order was not posted. except Includes. If the error continues please contact the administrator” might be more helpful to your users. . which are explained in detail in chapter 9.CLARION/PHP User’s Guide 139 This allows you to override the following for this procedure: • • • • • • Style Sheet HTML Template Generation of Help and/or HTML Files Show Help Link Show Navigation Buttons Titles and messages Associated With This Form (for example. instead of “Your Insert Failed. Includes • Please see the Global Options section for specific explanations of these options.

delete. . first turn security on globally. check the Override box on the Globals tab. then fill in the Security sub tab. Note that the checkbox is only available if you’ve turned security on at the global level. Check the Enable Security for this Procedure box. 2. The “Enable security for this procedure” checkbox option allows you to turn security off for this procedure. a filter is placed on all records limiting the rows viewed to those with the email (or other session variable) in that particular column. Similarly. UserEmail is used. because many sites have adopted the email address as a common identifier. by overriding the global security option you may add ‘My Records” functionality. The general process is as follows: • At login the end user uniquely identifies themselves. You must enable “My Records” support on a procedure-by-procedure basis (both browses and forms). Check the Enable “My Records” filtering box. When the user adds a record to a “My Records” update procedure. search and view form procedures limit their scope to the users’ records. My Records The Clarion/PHP “My Records” support allows you to specify ownership of records by user.140 CLARION/PHP User’s Guide Note that the checkbox for security is only available if you’ve turned security on at the global level. it’s unique to each person and easy to remember). • • • To enable all this functionality. To enable “My Records” on a form. This is stored in a session variable (usually. as described in the following section. Form Options/GlobalsTab/Security Sub Tab To enable ‘My Records” filtering: 1. Each user then views and edits only those records for which they have ownership. one of the table columns receives the session variable (email). In a browse procedure. as explained below. Additionally. this is done without showing the field on the form.

By not enabling “My Records” on the browse. and using the employee table as the security table. • Once you’ve correctly set up the “My Records” options for each procedure. and then choose that session variable to compare to a department value in your primary form table. applies the necessary query filters. the employee ID as the user ID. 4. You may filter a form so that “managers” may edit only their “direct reports” by specifying the “reports to” column as the data column to compare. be sure to provide that your master security table and any tables you wish to provide “My Records” support for all include a field of the same data type and length. a message is displayed. as in the following examples: • The Northwind sample database’s employee table contains a “reports to” column. Therefore in many cases. you need do no more. You may name the columns whatever you wish.” editing the login. deletes and viewing the form. This column should be present in the form procedure’s primary table. Specifying a level requires a number between 1 and 99 which will then be checked against the user database (see Global Options). such as “Department. and then using the “UserID” session variable to test against the “reports to” column. you may declare an additional session variable. You may use the “My Records” variable to limit record access not only by user. Clarion/PHP automatically hides the necessary fields. changes. but by type of user. which you will use for these purposes. the managers can see a listing of all employees. If not. else they will not appear within any users’ “My Records” filter. . you need not specify the same name for the column in every table for which it appears. but then can only link to an edit form for their own employees. You could similarly substitute “region. 141 Select the data column that is to store the user information to test against. In many cases. Select the session variable to test against it. which is configurable by the developer in the global settings. Clarion/PHP’s global level security dialog. When you design the database.” “sales territory. the page is then accessible.” etc.php page to assign the session variable based upon department data which you would store in the security table.CLARION/PHP User’s Guide 3. Note that should you be applying the functionality to existing data and are adding a column to a table that you must add the values necessary for the existing records. web sites use an email address as a unique identifier. and takes care of setting the data defaults for new records. you’ll simply pick the UserEmail session variable. if the user meets or exceeds the requirement. Similarly. Security Levels You may set separate security levels to permit adds.

. Navigation These boxes allow you to override the navigation button “tool tips” as well as providing a custom “first” or “last record reached” message.142 CLARION/PHP User’s Guide Titles (Insert/Edit/Delete/View/Search) These boxes allow you to specify the name of the page for each of the actions. Form Options/ActionsTab The Actions tab allows you to set the update functionality. The page title appears in the caption bar of the end user’s browser. Messages These boxes allow you to override the default status messages which display following the completion of the update procedure. and whether following an update the end user should see a status page or a custom page.

for example. will merge the values of any known symbols into that page. if you’ve defined it as the target. type a URL in the box(es) marked “Page to return to” next to the action you wish to tie the page to. The “return” mechanism thus provides for the following additional functionality: • Display Security Variables or User Defined Variables in the Target Page: by default. You may insert any of these into the target HTML page and the merge routine will substitute the values. any user defined variables which you defined at the global level. Return to Calling Browse or Query Form: you may also use the “return” mechanism to deliver the end user back to a browse or query form after a successful insert. using a mechanism similar to the HTML runtime template technology. This provides. as below: If instead you prefer that the end user is sent to a page of your choice. Additionally. Or it may simply return the end user to a “table of contents” page. the end user views a status page stating that the update succeeded or failed. @UserEmail@.” via which the end user is presented with a new blank add form following a successful insert. and which you stored values in (at previously executed embed points) are available. you must add a URL parameter: ?SUBSET=TRUE. the symbols available for insert are the security session variables (@UserID@. a convenient way to provide for “repeat adds. change or delete.CLARION/PHP User’s Guide 143 Allow (Insert/Edit/Delete/View) Check the boxes for the actions you wish to enable. there will be no effect on the page the end user sees. • . If you do not insert any symbols. and @UserName@). Note that should you wish to return the end user to a browse which had previously been filtered. Note that View provides for a read only form. Page to Return To Normally after an update. following the insert. and Clarion/PHP. The “return” mechanism provides additional functionality in that you may add a template symbol to your own HTML or PHP page. if security is active.

fills in “half” the form. found on a line such as): TemplateText = Replace(TemplateText. These procedure pages end in “addx. and then displays that message. following these guidelines this same functionality works for any add linked to from any page (not necessarily a previous add).php. Note: Repeat Add Mode does not depend on the “return” mechanism. a variable called “mystatus” holds the “your insert/update succeeded or failed” message which the end user normally sees after an operation. The general process for executing this would be: (1) declare user defined variables for each of the repeated fields at the global variable. (4) at an embed point after opening the record set. and that is what is output by IIS to the browser. "@CustomersCompanyName@". The Builder page retrieves the data and places the form before the end user. then displays the status message or routes the end user to the next page as defined in the Actions tab.php. so that the end user.php. The result is a complete HTML page. displaying the “success” message at the top of the . Builder Page Information The Form Actions tab provides a convenient point at which to document the Builder functions. assign the value of that variable to your user defined variable such as: SESSION(“myUserDefinedVariable”) = CustomersCompanyName Finally. Within the Processor page. and replaces each with the data and formatting instructions corresponding to each symbol. automatically retrieving the values previously stored in user defined variables for that session. If you wish to display that message in a page of your own. These are the procedure pages ending in “add. (3) in an embed point such as prior to closing the record set. or to a different Clarion/PHP generated target page (for example. The Add.144 • CLARION/PHP User’s Guide Repeat Add Mode With Prefilled Fields: in some cases the developer may wish to set certain fields on the add form to repeat the previous value.” This requires embed code in the add form. The “return” mechanism merely provides a convenient entry point in that in many cases the developer wishes the Repeat Add Mode functionality for a series of “rapid fire” adds.php. and Edit actions are each divided into two separate PHP pages: a Builder and a Processor. and each subsequent add only requires that they fill in the other “half. locates all @symbols@. CustomersCompanyName) Then. though not directly controlled by the template interface.” The Processor page executes the update or change. assign the opposite of the above.” or “edit.” The merge function opens the HTML runtime template. The Processor page therefore performs the operation. (2) examine the PHP source for the Add page and identify the variable name used in the PHP code (normally TableNameFieldName.” and “editx. in effects.

CLARION/PHP User’s Guide 145 next update form in a repeat add). Parent Browse Specify the name of the browse procedure that will link to the form. and then output your page to the end user. as described above. Generate QBF If checked. Whether or not you display the message in your page. When the end user clicks on the link. simply assign ud_YourVariable = mystatus). . Note: if your help text is extensive. specifies the generation of an additional page containing a Query by Form. as well as the browse that will appear subsequent to the Query by Form (if the previous box checked. This provides you with a flexible means of routing and informing the end user through each update or insert operation. the window may cover the application window. search for any user defined @symbols@ (as listed in the user variables tab of the global extension). the form will automatically run the query and display the results in a parent browse. merge/replace those symbols with the corresponding variables. Should this be the case you must educate your users so that they know to close the help window to return to the application pages. by entering a page of your own in the target action. you must use one of the Processor embeds (see chapter 8) to store the message in a user defined variable (at the last embed point in the Processor. after the update operation the Processor page will open that file. the help page you specify will appear in a popup window. Help URL (Insert/Edit/Delete/View/Search) Specify a URL for each of the appropriate actions. Upon user entry. Form Options/Help The Page tab allows you to set the help links for the page.

You may not include fields from other tables (even as display only fields) on your form. • • Form Primary Table: the table to be updated. Choose a table from the dictionary. except (1) by populating the file drop control template in the window formatter. It contains the following three sub tabs: Connections This tab allows you to select the connection object you want to use for a specific action Table Tab The form template is designed to retrieve and update a single table at a time. or (2) by editing the . Unique Key: a unique key which identifies the row. you may press this button to immediately update the SQL select statements. Note that the latter process is demonstrated in the Annotated Examples book. else the SQL will regenerate only after you close and then reopen the procedure properties. .php file post generation. modifying the FROM clause.146 CLARION/PHP User’s Guide Form Options/Data Access Tab This tab allows you to customize the SQL used to manage the update form. using the ellipsis button to select from a list. SQL Tab • Regenerate SQL: should you change the form controls (using the WINDOW structure).

You may edit the statement. should you wish to edit the statements manually. SQL for Selection Sub Tab This displays the SQL statement to retrieve the row. SQL to Delete Row Sub Tab This edit box displays the SQL statement to delete the row. It is . “SELECT (fieldlist) FROM Person WHERE Person. If. the programmer deletes two columns from the select statement without deleting them from the window or choosing the “do not populate” option. Moreover. Thus. you may manually edit the SQL/PHP statements separately. note the PHP concatenation operator is “. however.” The concatenated part provides for a PHP function to obtain the unique value for the ID field. Form Options/Controls Tab The Controls tab allows you to specify the properties for the columns which appear within the form. You may edit the statement. Note that the column properties for the control are picked up from the Dictionary with some limitations due to the differences in available properties for HTML controls.ID = “ . Note that the default syntax will include both SQL and PHP code. in the order they appear in that structure. so that opening the procedure after editing the window or pressing the Regenerate SQL button does not override your manual changes. and forms the value for the where clause. manually changing the select statement does not edit the columns that the page will contain. Additionally. the programmer assumes full responsibility because there is no error checking of your changes. using the PHP Request function and the column name. as requested by the calling page. Those controls auto populated correspond to the controls in the procedure’s window. If you wish to change the control order.CLARION/PHP User’s Guide 147 Because you may manage both PHP and ASP applications with the same extension. but the second part is comprised of PHP. and because the PHP statement to retrieve the URL parameter identifying the unique ID will be different for the two platforms. getRequest(“ID1”). the programmer assumes full responsibility because there is no error checking of your changes. Note the double quotes for the first part of the statement. Choose one tab or the other. check the “Freeze SQL Statements” box. button next to the Window button in the Procedure Properties dialog) or change the tab order using the Window Formatter. the runtime template will still display the columns as empty edit boxes. however. Important: if you wish to add or subtract a control.. you must either edit the window structure as text (using the . add it to or delete it from the window.. If you’re used to ASP. The first part of the select statement is the main select. for example.

which contains the following sub tabs and options: Appearance Sub Tab . This presents the Controls dialog. select a control from the list and press the Properties button. Therefore. the PHP page correctly displays the value with four decimal places. includes a price field in the Products table. This data type is “money. This particular field is also defined in the database as having a precision of four. Example: formatting pictures do not come from the dictionary.” Therefore.148 CLARION/PHP User’s Guide important to review the properties for each control. The MS SQL Server Northwind sample database. as an example. they come from ADO. instead. using the local currency symbol as set on the SQL Server. To review the control properties. a Clarion/PHP application will correctly display a currency symbol for this value.

or short/long date format. therefore it is vitally important that on input. the server will return an ADO error. a picture provides for two decimal places. Choose from Input (entry box). Secondly. for example. or upper case. querying a non-indexed field may require greater effort on the part of the DBMS. or if a long date is provided for but the end user types in a short date. If. chances are 80% of the queries will only require 20% of the fields or less. . the simpler. Firstly. lower case. the end user must be educated on what the acceptable input is. It means the query seeks records for which the value for that field is false. Caption: the equivalent of the prompt text for the control. Note that older versions of Netscape do not. Internet Explorer and the latest version of Netscape utilize this text as a tool tip. Formatting Function: optionally select DateTime. There are excellent reasons for omitting fields from the Query by Form. Tool Tip: the “tool tip” will be inserted as an ALT tag for the control. the less fields. Radio. Each choice provides additional appropriate options such as the number of decimal places for number formatting. Check (Checkbox). HTML Form Element: the control type. Bear in mind that these are the native HTML control types. Note that the control type choice will affect the options in subsequent tabs. This concept could be confusing for many end users. and the names used are those used when populating an HTML form. Read Only: check this box to disallow editing of the selected column. Omit From QBF Page: this deletes the field from the Query by Form page. The pictures apply to both display and input. but the end user types in three. • • • • • • • Note: remember when populating a checkbox control on a query form that unchecked does not mean null (or no choice for that field). and Text area (multi line text box). therefore we recommend that when using Queries as a main navigation aid for your applications that you review the use of checkboxes. Number.CLARION/PHP User’s Guide • • 149 Populate: enable or suppress (don’t generate) the control on the generated PHP page. Select (List box). Password: optionally specify password field entry. Currency or Percent to specify formatting. Case: optionally specify case conversion to normal. Note that mnemonics and accelerator keys are not possible.

they are provided only for display. Note that “My Records” filter fields will appear in the controls list as normal. and fill in the edit boxes according to the choice. Choose the validation options.150 • • CLARION/PHP User’s Guide Maximum Characters: allows you to size the controls (width only). lesser than. which will help reduce network traffic. and fill in numeric values. highest. they will be hidden from the end user in the update form. Note that the typeface in all text area controls in monospaced (the text looks like typewriter text). Must Be In List: this works in conjunction with the List options set in the dictionary. You may not edit the list values here. than the validation is greater than the value. or both. this allows you to specify the width in characters and the height of the control in lines. If lowest is checked. Must be in Numeric Range: self-explanatory. Cannot be Null: self explanatory. For the numeric ranges. and there is no method of changing this. however. and the Alert text. Be sure to fill in the Validation Alert Text Message. Validation Tab Sub Tab This tab is enabled only when the HTML Element (on the Appearance tab) is an entry or text box. This is a limitation of HTML. check either lowest. • . the value must be in between low and high. Fill in at least one of the Numeric Range options. This allows you to specify client side validation. Should you wish to change the options you must change the dictionary. Rows and Columns: for text area controls. • • • No Validation: self-explanatory. highest. and both.

and the entry box then receives the proper value according to whichever row in the select browse the end user chooses. You must also specify the target column of the select browse whose value should match this column. If you forget to make a choice. You may specify a range limit for the select browse. . You must manually choose the proper select browse for all the “Must be in File” columns which appear in the update form. You must also apply the browse extension template to the Select Browse procedure in order for Clarion/PHP to generate an PHP page for the select browse. The end user may then press the button. if the select is to choose a product ID. As an example. the procedures dropdown list will default to the first browse in the application tree. Press the Insert button in the “Lookup from File” tab to choose the source and target columns. You may have to insert the related table into the field chooser dialog. You must additionally choose a select browse from the dropdown list. the select browse can range limit to that category ID. which will be presented to the end user in a message (or popup) box. utilizing the current value of any of the entry fields in the current update form. choose from the select browse popup. it is likely that the lookup button will display an entirely different browse in the popup. one which may not even contain “clickable” fields from which to choose a value. matching it to a column in the select browse. Must Be In File: allows you to specify a primary/foreign key relation as set in the Clarion dictionary. This will call the select browse with a WHERE limiting the browse to only those rows that match the current value of that field on the update form. The Value to Pass dialog allows you to select a source column.CLARION/PHP User’s Guide • • 151 Alert Text Message: this provides you with the ability to type in a string. It automatically populates a select button next to the entry field. This behavior (on an entry field or HTML input) mimics the Clarion Lookup behavior. and the end user has already specified a category ID.

152

CLARION/PHP User’s Guide

Select Options Sub Tab
This sub tab is displayed only if the HTML Element (on the Appearance tab) is a SELECT (list box). As an alternative to placing a link to another browse to perform a “Select” lookup, you may use a file loaded list box for your control (selecting it in the HTML Element for Insert choice on the previous tab). To initiate the automatic use of this feature (i.e., so that Clarion/PHP supplies it when you apply the template extension to the form), place a FileDropCombo or a FileDropList into the window. Clarion/PHP will then add the column in the related table to the controls list. The HTML element will appear as a combo.

CLARION/PHP User’s Guide

153

The Combo Options Sub Tab offers these options: • • • • • Unique ID Column: the column in the related table providing the unique value by which to identify a choice selected from it. Value Column: the column in the related table providing the value for the target column in the form’s primary table. Display Column: the column in the related table from which you which to display data for the user to select. Target Column: the column in the form’s primary file into which you wish to save the value selected by the user from the related table. Lookup SQL: if you’ve placed the template as above, you’ll see the SQL statement to retrieve the values from the related table. In some cases it may be necessary to edit this statement.

Form Options/Custom Controls Tab
The Custom Controls tab allows you both to specify that additional non-data columns should appear within the form, and their properties. They may appear as images or strings. To insert a column, press the insert button and define its properties. To review the custom control properties, select a control from the list and press the Properties button. This presents the Controls dialog, which contains the two sub tabs and options. On the appearance tab:

154 • • • • • •

CLARION/PHP User’s Guide Populate: this checkbox indicates that you wish to generate code for this custom control. Control Name: merely provides a convenient way to reference this column. Caption: provides for a label which appears to the left of the field. Control Location: specify that it appear either at the top of the form or at the bottom of the form. Populate From: specify static text (including null) or a session variable. Enter Display Text: enter the text the end user should see, or a null string (leave it empty) should you wish to display a graphic.

On the Actions tab: • Create this as a Link: specify the link type (procedure or custom) or not as a link. In general, not creating a link is simply a means to populate a picture on the form that doesn’t do anything. To populate a picture that leads the user to another page, specify a procedure or custom link. Pass this Data: allows you to pass the value of this control to a procedure. Data Column to Pass: allows you to define which column from the form contains the data to pass. Session Variable to Pass: allows you to define a session variable to pass to a procedure. Static Entry: allows you to pass a string to a procedure. Additional Parameters: allows you to pass additional parameters when specifying a procedure link with static entry. Fill in in the format parametername=value, or parametername1=value1&parametername2=value2. Procedure Link: to enable the link to open an update procedure (or another procedure, for that matter), check the “Procedure Link” box and specify the name of the procedure from the dropdown list. Remember to apply the PHP form procedure to the procedure you select. Indicate in the second dropdown box the action to apply to the procedure: whether it’s to view data only, or to add, edit, or delete a record, or to list data, as in the case of opening up a browse on a child file. Type of Procedure: specify the type of Clarion/PHP the target procedure is (list, add, edit, or delete).

• • • • •

CLARION/PHP User’s Guide •

155

Custom Link: allows you to add an HTML or JavaScript link in the Custom Link edit box below. You have complete control of the link, which means that you may specify custom tags such as Flash files.

You are responsible for everything starting with <A> to the </A> tags for this link. You may concatenate strings and Java functions, and reference session and data variables using JavaScript functions. It’s important to note that the text you enter in this box will be temporarily stored in and PHP string variable, and therefore will be surrounded with double quotes. The code surrounding yours will appear with yours as:
mylink = “ YourText/CodeGoesHere “

This means that if you mix string and functions, you must watch your concatenation. If your custom link is (1) string only, just type your string and not worry about the quotes: MyString If your custom link is (2) a string with a function concatenated behind, don’t forget to close the opening quote, concatenate your function, and then open the following quote: Mystring” . MyFunction(param) .” If your custom link is (3) a function with a string concatenated behind, don’t forget to close the opening quote, concatenate your function, and then don’t close the following quote: “ . MyFunction(param) . “mystring If your custom link is (4) a function only, don’t forget to close the opening quote, concatenate your function, and then close the following quote: “ . MyFunction(param) . “ If you have several elements, just remember where the quotes will be. To reference a session variable, refer to ti as $SESSION(“variablename”). To reference a data element in the current form, use an ADODB function to return it from the recordset: oRStablename(“fieldname”). You may use text functions to trim the string, as in: trim(oRStablename("fieldname")).
<a href='BrowseProductsList.php?WHR=dbo.Suppliers.SupplierID1=" . trim(oRSSuppliers("SupplierID"),1,50) . "'><img src='/IMAGES/products.GIF' width='32' height='32 alt='Products' border='0'></a>

156

CLARION/PHP User’s Guide Because the custom link options are almost completely free form, they serve as a close facsimile to placing embedded JavaScript in your applications. • Image Button: press to provide details for displaying an image in this cell.

If you’ve chosen to display an image in this column, you must fill out Image dialog after pressing the button: • Populate From: specify whether the image resides as an external file or a binary column in the database. Note that Clarion/PHP has tested binary images stored in the MS SQL Server database. File Name: if the Populate From option points to an external file, specify the file name. An example use of a static image might be a small pencil image, symbolizing a link to an update form. Remember that the file name must be either relative to the application’s web directory, or to the web root directory. ID Value Column: if the Populate From option points to an image stored in the database, specify the unique ID column for the row. Table With Image: if the Populate From option points to an image stored in the database, specify the column containing the image. Making this a separate option, allows the DBA to store the images in a table separate from the table used for the browse. ID Column: if the Populate From option points to an image stored in a separate table in the database, specify the unique ID column for that table. Image Column: if the Populate From option points to an image stored in the database, specify the column containing the binary image data. Image Type: if the Populate From option points to an image stored in the database, specify jpg, gif or png.

• •

• • •

CLARION/PHP User’s Guide

157

Ch. 8: PHP Embeds
The Clarion/PHP template provides the developer with the opportunity to write their own PHP, ADODB and/or SQL code (dependent upon the embed selected) which will execute inside and along with the code that Clarion/PHP generates, without fear of the developer’s custom code being overwritten at generation time. Clarion/PHP accomplishes this through embed points in the browse and form procedures. The developer chooses an embed point (each is described below), and presses an Insert button. The source code editor appears, and any PHP script added will be saved in the app file. In conjunction with user defined template symbols (which the developer is responsible for inserting into the run time templates), the source code is executed when the page is processed, and the output of the developer code (as assigned to the user defined variable matching the template symbol) is merged into the output page, for the end user to see. The developer adds any user-defined variable on a tab in the global extension; Clarion/PHP inserts session variable declarations in the appdata.php file, which means that the variable and its value can be accessed by every page that executes. We suggest using a prefix to your variables such as ud_ (user defined), as in ud_MyVariable. This could make it easier to understand your generated pages and avoid name clashes. As an example declaration:
if IsNull(getSession("ud_myDataVar")) : $SESSION["ud_myDataVar"] = ""; endif;

In the code above, we first check that there’s not a variable already declared (since this is called by every page), and if not, then we declare it. As another example, the developer may declare a user defined template symbol called ud_MyVariable. The developer might then insert a column into the runtime template for a browse, and place the corresponding symbol there. The symbol should be the variable name preceded and suceeded by an @ sign, as in @ud_MyVariable@. Continuing the example, within the embed tree the developer locates the node labeled “After start build (html) rows.” The end user inserts code that calculates whatever the value should be for ud_MyVariable, and assigns it. (Remember that the PHP code written by the developer has access to the values in the current record; thus, a running total, for example, can be coded. The developer should also recall that they should destroy any objects they create. Session objects may also be created and used).

158

CLARION/PHP User’s Guide At run time, that code executes, it gets merged, the value appears alongside the other values in that row, and in all the other rows of the browse, according to what the proper value should be. Other embed points are available; the embed point within a browse row was just an example. The templates exercise no limits on the PHP code you insert. You may, for example, reuse a connection object, create a new SQL statement and recordset object, and add, say, a count and grand total of all orders for a customer by opening a details table and using an aggregate query, even though the PHP page generated by the template never opens that particular table.

Global Template Declarations
To declare a user defined variable, open the PHP global extension. Scroll to the tab at the extreme right called “User Data.” Press the Insert button and enter the user variable name in the User Data dialog. Do not add @ signs to the variable name.

Assuming the developer wishes to display the results of their code within a page, the developer or web designer edits the desired runtime template and inserts the @variable@, i.e., the variable name surrounded by the @ sign at the appropriate place in the page.

CLARION/PHP User’s Guide

159

Accessing the Embed Points
To access the embed points, the developer selects a browse or form procedure with the Clarion/PHP extension already populated, double clicks the embeds node in the right hand pane of the Application tree, or right clicks the procedure in the left pane and chooses embeds from the popup menu, or opens the Procedure Properties dialog and presses the Embeds button. By expanding the list of Embeds, the developer may then locate the top level Clarion/PHP embed node. The nodes underneath represent the embed points. To insert a new piece of code, the developer may select a CODE node underneath the node with the description of the execution point desired and press the insert button. To edit an existing embed, the developer may double click the node showing the first line of their code. The Select Embed Type dialog appears. The developer should select Source to write PHP code. The source code editor (also referred to as the Embeditor) appears when inserting or editing code. The code is automatically saved when closed. To delete existing embed code, select the node showing the code and press Delete. Remember that any embed code will be evaluated by the PHP module, and must therefore be valid PHP code.

Browse Embed Points
The Clarion/PHP browse extension contains the following embed opportunities:

Connection Object
• • After Opening the Connection Object Before Closing the Connection Object

Recordset Object
• • After Opening the Recordset Object After Starting to Build the Data Rows (this refers to the loop for each record within the browse table, during which Clarion/PHP gets the contents of each field, formats it, and stores it in the symbol for output. Use this embed point when using a variable that should display a different value for each row of the browse table. This allows you to execute your code before the first column value is assigned; the record set is already open at this point). Before Ending the Building of Data Rows (same as above, except after all the column values have been assigned).

Hence. “edit. submitting the update and providing the status message with the results. in the format UpdateProcedureNamemode.php. You may see the implementation of this when looking at the php directory.” “Edit.” and “View.160 • Before Closing the Recordset Object CLARION/PHP User’s Guide Form Embed Points The form embeds have four separate sub nodes for the four update modes: Add.” The page without the X “builds” the html interface for the end user. You may see the implementation of this when looking at the php directory.” “Del. “addx.php”. this page is called the “Builder.” The “X” page receives the edits and processes them. ending in “add.php”. and “editx.php. and seeing four separate pages for each procedure. the developer must copy the code from one to the other. in effect. and is called the “Processor. Edit. with mode being “Add. the Add and Edit modes each have two “phases:” Builder and Processor.” . and seeing two pages each. Delete and View.php”. Moreover. retrieving the data and presenting the entry controls.” Should the developer wish the same code to execute on more than one mode.

calculation of values for hidden fields. the ability to calculate a user defined variable which is to display in the page. for example. This allows. for example. such as extended totals. allowing. modifying the connection string. • • • After Opening the Connection Object Before Closing the Connection Object Before Executing the Delete (Delete mode only) Recordset Object This allows the developer to insert code before and after accesses to the record set. Edit and View modes only).CLARION/PHP User’s Guide The embed opportunities in the form procedures can be organized as follows: 161 Connection Object This allows the developer to insert code before and after connecting to the database. for example. • • Before the Merge Call After the Merge Call . before saving. allowing. Merge Call The merge call refers to the point at which the PHP code replaces the symbols in the runtime HTML template with data values from the row. • • • • After Opening the Recordset Object Before Closing the Recordset Object Before the Update (Add and Edit modes only) After MoveFirst (this executes after opening the recordset and moving the cursor to the first record.

the status message that appears is indeed a “merge. however.162 CLARION/PHP User’s Guide Status Merge Call (Delete Only) The merge call for a delete procedure has no interaction with an HTML runtime template. • • Before Status Merge Call After Status Merge Call .” This embed category provides the developer with the opportunity to insert code before and after the status message which appears at a delete operation.

Name the variable to be used (ud_lastpurchase). Select the PHP extension. In effect. done some other maintenance. and at runtime. your custom code therefore performs a “related” task to that performed by the Clarion/PHP procedure. etc. The custom code uses the current connection. defines the SQL select using the current customer value. sorts them by date descending. Right click and choose Embeds from the popup menu.CLARION/PHP User’s Guide 163 Examples Form Embed The example below modifies the customer view only update form from the Orders example (see the Annotated Example book). declares a new recordset. press OK and return to the application tree. the most recent order for that customer appears. Locate the Clarion/PHP view mode nodes in the embed tree. assigns it to the user defined variable. Step One: Define the User Variable • • • • • Press the global extensions button. opens the Orders table (which otherwise would not have been open). Select Source Code/Source. Press the Insert button. In the runtime template. . gets the first (most recent) date. Step Two: Add the Code • • • • Select the UpdateCustomers procedure in the application tree. a symbol corresponding to the variable is placed at the bottom of the form. It could just as easily have called a stored procedure. Select the User Data tab. Select the RecordSetObject/AfterMoveFirst/Code node and press Insert. then closes the record set. retrieves the orders for that customer.

and you don’t wish to overwrite the changes at the next regeneration).Orders WHERE dbo. Note that the PHP merge routine is case sensitive. endif.CustomerID = '" .Orders.htm in your HTML editor.OrderDate FROM dbo. "' ORDER BY dbo. Within the extension properties for the procedure. // Declare a recordset variable and create it by using the Connection object Execute method and the SQL statement $ud_rsTemp = &$objConn1->Execute($ud_MySQL). and optionally use the “label” class for the prompt. else: // else.app and generate the PHP source. $oRSCustomers->Fields("CustomerID") .. If you wish it to match the rest of the fields on the view form. if ($ud_OrderCount > 0): // Move to the first record $ud_rsTemp->MoveFirst(). Add a prompt.164 CLARION/PHP User’s Guide We’ve commented the embed code (note that should you wish to cut and paste it into the embed point you must clean up any word wrapping!): // Display the last purchase date // First.Orders. such as “Last Purchase” to the runtime template.OrderDate DESC". be sure that to use the “input” class. // and dispose it unset($ud_rsTemp). // Close the recordset $ud_rsTemp->Close(). clear the variable $ud_lastpurchase = "".Orders. // and assign the ud_lastpurchase variable $ud_lastpurchase = $ud_rsTemp->Fields("OrderDate"). Open html\UpdateCustomersview. • • Save the embed. so it must match your declaration. check the “Do Not Generate HTML” on the overrides tab (you must now edit the runtime template. // if so. Add a symbol (perhaps at the bottom of the current form) for @ud_lastpurchase@. // Check if there are recors $ud_OrderCount = $ud_rsTemp->RecordCount(). declare and init the variable for the SQL statement $ud_MySQL = "SELECT dbo.. • • • . Save the .

The end result should look something like this: 165 .CLARION/PHP User’s Guide • Deploy and test.

unset($ud_oRSTemp). // Do not forget to clean up! $ud_oRSTemp->Close().Subtotal) AS SumTotal.166 CLARION/PHP User’s Guide Additional Form Embed Since it’s a useful code snippet. "WHERE Orders. $oRSCustomers->Fields("CustomerID") .CustomerID " . we apologize for any extraneous word wrapping: <<< example code will change >>> // display total purchases // declare a new recordset and SQL string variable // use some unique prefix to prevent name clashes // with generated variable names // // Reuses the record set variable and the string // for the new SQL select statement from the last embed // Initialize the SQL select statement // Concatentate the current customer ID from the Customers recordset // which is already open.CustomerID" // Open the recordset using the existing connection object // and move to the first (and presumably only) record $ud_oRSTemp = &$objConn1->Execute($ud_MySQL). queries the necessary tables and places the sum of all this customer’s purchases (from the Order Details) into that variable. the following code.php) $ud_RecCount = $ud_oRSTemp->RecordCount(). and using a user defined variable called ud_SumPurchases.CustomerID = '" . As before. "' GROUP BY Orders.OrderID " .OrderID = [Order Subtotals]. // Test that it is not empty otherwise the customer never ordered // anything and display the word none // and use the format currency function (found in utils. inserted at the same point above. if ($ud_RecCount > 0): $ud_oRSTemp->MoveFirst(). "FROM Orders INNER JOIN [Order Subtotals] ON Orders. . Orders. endif. $ud_sumPurchases = FormatCurrency($ud_oRSTemp->Fields("SumTotal")). else: $ud_sumPurchases = "". Do not forget that that value is a string // so you have to add the single quotes! $ud_MySQL = "SELECT SUM([Order Subtotals]. and to better aid your understanding.

Select the RecordSetObject/AfterStartBuild/Code node and press Insert. Select Source Code/Source. and then follow these steps: Step One: Define the User Variable • • • • • Press the global extensions button. Press the Insert button. press OK and return to the application tree. such as ?ID1=10248). Select the PHP extension. clear the variable $ud_LineItemTotal = "". Right click and choose Embeds from the popup menu. The fields used in the example are Quantity. apply the global and browse template. minus Discount. UnitPrice and Discount (Quantity times UnitPrice. Select the User Data tab. . hence. Step Two: Add the Code • Select the BrowseOrder_Details procedure in the application tree. Name the variable to be used (ud_LineItemTotal). set the Order_ID field as the range select (be sure that your URL includes a valid ?ID1 parameter. Should you wish to create an equivalent example. the record set is open to each of the records in turn. endif. • • We’ve commented the embed code (note that should you wish to cut and paste it into the embed point you must clean up any word wrapping!): // First check that Quantity isn't 0 if ($oRSOrder_Details->Fields("Quantity") > 0): // Now you can get the recordset variables and calculate $ud_LineItemTotal = ($oRSOrder_Details->Fields("Quantity") * $oRSOrder_Details->Fields("UnitPrice")) . else: // otherwise.$oRSOrder_Details>Fields("Discount").CLARION/PHP User’s Guide 167 Browse Embed The example below provides a line item total for the Order_Details table of the MS SQL Server Northwind sample database. wizard an application on this table. The “concept” for this example is that you wish to calculate the value at the point for each row at which the code is ready to place the values into the symbols in the HTML embeds. equal the LineItemTotal). and your embed code can do a calculation on the fields.

. a column inserted at the end with no style tag. and the symbol @ud_LineItemTotal@ placed in the cell in that column. The simple browse below contains no customizations. All this line does is clear the variable after we’ve merged it into the form: $ud_LineItemTotal = "".168 CLARION/PHP User’s Guide Step Three: One More Line of Code To make this work properly in case you’re at the end of the table. Type the following code. Note that the HTML runtime template was edited with an HTML editor. but merely demonstrates the code. Select Source Code/Source. To do so: • • Select the RecordSetObject/BeforeEndBuild/Code node and press Insert.” you’ll need to make sure the variable is cleared after each pass. but ten rows of “browse. have only three rows of data. data formatting nor style sheet customizations.

the general areas of functionality that these include points may provide for are: • • JavaScript function libraries for client side execution. however to understand when and where the include occurs will help you to use this feature to extend your applications. Standard “boiler plate” HTML sections such as company contact information or even banner ads. Note that it’s a simple matter to take a “blank. allowing you to provide related functionality to any procedure.htm” file.CLARION/PHP User’s Guide 169 Ch. . • Understanding the Process The actual mechanism simply opens the include file and writes it into the runtime HTML template at the time the end user requests the document. If you don’t use the includes feature. and cut and paste the lines into an existing design time HTML template. Through use of the HTML includes you can include different sections above and below the Clarion/PHP elements on a procedure by procedure basis. This provides for server side include functionality. Though not limited to only these three. which allow for a single update throughout a site whenever something changes. The include file may contain either HTML or JavaScript (for client side execution). An almost “componentalized” approach to the HTML layouts for your application. 9: HTML Includes Clarion/PHP includes the ability to specify include files which will be incorporated into the runtime HTML template. your design time template must include the HTML comments highlighted below. To take advantage of this feature. at the time the data is merged into the page. then they’re not required. based on the procedure. auto generated by the templates.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4. just locate the proper tags (<html>. <title>. <head>.170 CLARION/PHP User’s Guide Finding the correct places in your design time template to insert the comments should be a simple matter.01 Transitional//EN"> <html> <!--@HTML_AFTER_OPEN@--> <head> <!--@HEAD_AFTER_OPEN@--> <title></title> <!--@HEAD_BEFORE_CLOSE@--> </head> <body> <!--@BODY_AFTER_OPEN@--> <!--@BG_BEFORE_OPEN@--> @Clarion/PHP@ <!--@BG_AFTER_CLOSE@--> <!--@BODY_BEFORE_CLOSE@--> </body> <!--@HTML_BEFORE_CLOSE@--> </html> . <body>) which will no doubt be located in your design time template.

should you place a file called myinclude.htm. then the box should read html/myinclude.php page within your web. This allows you to provide for an include inside the portion of the page which will include the Clarion/PHP components. (For example. Remember that the path must be a relative reference to the location of your . and are not present in the design time template. The template interface includes a tab on the Global extension called Includes. It provides edit boxes corresponding to all the insertion points above. . Type in a file name in a box or boxes.htm in the project/php/html directory.CLARION/PHP User’s Guide 171 The illustration below displays the template interface: : A note on the <bg> tags: the “after open” and “before close” <bg> tags in the template interface refer to tags which will be inserted at the time the runtime templates are generated (when you run the Generate All command in the development environment).

31-Dec-02 16:14:21 GMT. you’ll create an include file that merely includes the other include files. Should you wish to merely experiment. it’s a good idea to do it this way. Note that should you wish to include more than one file in one include point. What to Use it For The most obvious uses are HTML boiler plate. it may very well be the case that you wish to define these on a procedure by procedure basis rather than on a global basis (which might normally be done in the design time template). placing the content of the included files into the spot chosen. For non printing HTML items such as meta tags. The keyword usage of the meta tag might typically be something like the following. • For java script function libraries. which can also be done with an include.172 CLARION/PHP User’s Guide At the time that the end user requests the PHP page that corresponds to the HTML runtime template page. and should be placed within the <head> tags: <META NAME =”keywords” CONTENT=”lions. the merge function will read the runtime template and any “included” files. such as: <META HTTP-EQUIV=”Set-Cookie” CONTENT=”cookievalue=xxx. and you’ll see a “table of contents” below your Clarion/PHP elements. simply make sure that the <script> tags are present in the include file. and that will be the file you place in the template interface. path=/”> . and then turn the combined document over to Apache to output the page. Remember that you may override the includes on a procedure-by-procedure basis. and if that is the standard operating procedure at your site. and place the include at the @HEAD_AFTER_OPEN@ include.expires=Tuesday. the script in the PHP page will be executed. By using the includes. Some may prefer to place the static HTML directly in the design time template. the developer need not edit the individual runtime HTML template for the procedure (saving the necessity of editing four templates for an update procedure). you must regenerate when the boiler plate information changes. else. include files with meta tag keywords. bears> • It may also be the case that you wish to set cookies on a procedure by procedure basis. allowing you to create an include file only with the meta tags that you wish for a specific procedure. and not incorporate it in the design template.htm file which will be automatically generated by Clarion/PHP. Many web designers prefer to use includes for standard boiler plate elements. feel free to include the procs. it’s simply a matter of preference on the developer’s part. javascript function libraries. simply include the file at the @BODY_BEFORE_CLOSE@ symbol. and server side commands: • For boiler plate such as a standard site footer. tigers.

Remember to check the override box to enable access to the sub tab. . the only difference is that the explanatory text does not appear above the edit boxes.CLARION/PHP User’s Guide 173 Final Notes The procedure overrides provide exactly the same insertions as the global.

174 CLARION/PHP User’s Guide .

though this may not always be useful should the code need to reference elements such as recordsets. because the developer may place any code whatsoever in the source code procedure. you may use the source code procedure for whatever you can think of. add a procedure to the Application Tree by selecting an existing procedure. then choosing Procedure > New from the development environment menu. This provides for any number of possible applications that may not be desired to execute until after a procedure is finished. and to make it easier to remember where you placed the code. which does not yet support triggers. Additionally. press the Extensions button. . which would still be in the procedure. you will see a new embed node called Clarion/PHP for the procedure. and you may use the Embeditor to write the PHP code.. (Note: you can apply the extension to existing procedures. for example. but if the application uses MySQL. you may utilize the source code procedure for trigger-like functionality. Once the Procedure Properties dialog opens. updating counters. allowing you to place the code in a single page. This is not meant as a substitute for triggers. and apply the PHPSource extension.CLARION/PHP User’s Guide 175 Ch. the source code procedure provides an alternative to writing php embed code in multiple procedures. analysis pages which might summarize data after the end user has entered data. we simply suggest a new procedure for organizational purposes. 10: PHP Source Code Procedure The function of the PHP Source Procedure template is to allow you to execute PHP code inbetween pages. such as redirection to other pages of interest to the end user based on the outcome of the previous page. Name the procedure and choose Source as the type of procedure. Application To create a PHP source code procedure.) Once the extension is applied..

176 CLARION/PHP User’s Guide At the time you apply the extension. This will be the page that the end user is redirected to after the source code procedure page executes. the page generated will be named in the format ProcedureNameSource. you will also note a “page to return to” box. . Note that a default security level of 1 is applied to the page. should security be applied to the application. This can be overwritten via a page parameter (?toURL).php. At generation time. To change the security level. edit the generated code.

but there’s no necessity to tax the DBMS with a query which returns the same result every time except if an insert. DisplayMyRunningTotal). Insert the @ud_MyRunningTotal@ symbol in the design time template.” Apply the PHP Source Code extension to the procedure. It would be a simple matter to insert embed code to display a user variable at the top of every page. in this case the designer might create a box in a top corner of the page in a bright color. • • • . display the running total). edit. for example. (for example. and in the box. since this is designed as something to execute between actions. Edit. Create a source code procedure (named. Set the “to URL” to whatever page is desired to be viewed after an operation. or setting the source code page as the “page to return to” for the Actions of an Insert. Assume a case in which a session variable is used to keep a running total of daily sales by a particular representative for that session. for example.CLARION/PHP User’s Guide 177 Usage The normal means of routing the end user to the source code page is either linking to it as a normal HTML link from within the referring page. “MyStartPage. Clarion/PHP automatically creates the session variable. such as ud_MyRunningTotal. the query could be stored as a source procedure. or delete was made (this assumes no other operator may change the representative’s records). The latter method is more appropriate. In this case. assuming that the intention is to display the running total on every single procedure. or Delete page. The procedure to accomplish this would require the following steps: • Declare a the user defined variable for the running total.php. When added in the global extension. and query the database each time a new page displayed. and the source procedure could be called only after an edit change or delete. the result stored in the session variable.

// // Open the recordset using the connection object // and move to the first (and only) record $ud_oRSRecordset = &$objConn1->Execute($ud_mySQL). $objConn1->Close(). “UserID”. set the “Page to return to” for insert. $objConn1->PConnect(“YourServer”. update. recordset. and delete to (in this case) DisplayMyRunningTotalSource. unset($ud_oRSRecordset). unset($objConn1). • Save the embed. // // Clean up! $ud_oRSRecordSet->Close(). “Password”. • .ORDERS. // Set the SQL statement $ud_mySQL = “SELECT SUM(ExtendedTotal) AS RunningTotal FROM dbo.RepID=123”. $ud_oRSRecordSet->MoveFirst(). // // Use the format currency function with 2 decimals // and store it in the session variable $ud_MyRunningTotal = formatCurrency($ud_oRSecordSet>Fields(“RunningTotal”)). and then open the update procedure for Orders. “northwind”).ORDERS WHERE dbo. On the Actions tab. Generate and test. and storing the return value in the session variable (note: we apologize for any word wrap problems): // //Declare connection object. running the query. and query string $objConn1 = &ADONewConnection(“mssql”).178 • CLARION/PHP User’s Guide Add embed code to the procedure declaring a connection object.php.

the process by which you work with the style sheet editor is: • • • • Create a new style sheet by name within the global extension template. Or you may specify that one browse use the first. and on the global tab press the Style Sheet Editor button. and choose your formatting. If you wish to use a style sheet from one project in another project. Use the style sheet editor to walk through the list of browse and form components. . The concept is very simple: each of these parts has a style class name which we’ve defined. The style sheet editor lists all the parts and allows you to set the appearance options. we recommend that you collaborate with your web designer and have on hand the RGB values for the preferred site colors and the font names used at the site. Deploy the . and simply place it at your site. Overall. Turn off CSS generation in the new project. open the PHP global extension template. alignment. just the formatting options associated with them. including step by step instructions for matching the colors and other formatting options used in the sample applications. The only things which don’t change are the style classes themselves. formatting. You may make a style sheet in which the table background is blue. 11: Style Sheet Editor The style sheet editor allows you to create your own style sheets and specify the fonts. You can create as many style sheets as you wish. you may create another .CSS) for your use.php pages. and the other for another.CSS file to your site when deploying the . For creating pages which seamlessly merge into an existing site. You may specify that two applications use the same style sheet (just give it the same name and copy it to the styles directory). Should you wish to change only the site appearance. overwriting the original style sheet. and positioning formatting for the parts of the tables and forms you’ll be creating with Clarion/PHP. • To begin the process of editing your style sheet. It may be that you use the one style sheet for one project. and a second use the other.CSS sheet at any time. you must copy it into the current styles directory and enter the style sheet file name. promoting a uniform look. Note that the Annotated Examples manual provides a great deal of detail. You may create a different one for which the style sheet is red. These options are stored in a file (with an extension of . which can vary from style sheet to style sheet. You may then duplicate those using the style sheet editor. plus the name of the data row style(s) into the new project.CLARION/PHP User’s Guide 179 Ch.

Be sure to choose either a color box or a custom color. etc). Style Sheet Tab The first tab provides an option of changing the style sheet name plus the ability to set hyperlink formatting. As you know these are valid choices for a Windows program. To create a new style sheet. Because we’re using the default color pickers within the Clarion template interface. There is one important thing to remember when choosing colors. unless using Cascading Style Sheet specification 2. button highlights. you may now format the individual elements in the Style Sheet dialog. but invalid for an HTML application. select it and press Delete. select it and press Properties. The template system will resolve your choice to a hexadecimal value (red/green/blue). at the top of the color picker dialog you’ll see the choice for Windows component colors (such as the window background. through this dialog. .180 CLARION/PHP User’s Guide If editing an existing style sheet. After choosing Insert or Properties. which means that older browsers will not be able to resolve that color choice. press the Insert Button.0. To delete an existing style sheet.

red for visited. To format each of the options.CLARION/PHP User’s Guide 181 • • File Name: type in a valid file name. simply uncheck the box). It will automatically receive a . Hyperlinks: you’ve probably observed that the default hyperlink colors for most browsers are blue for unvisited. press the appropriate button (labelled for each).CSS extension. Visited:The page pointed to by the hyperlink has been visited previously. For each state a button appears. and you may choose the exact formatting in the subsequent dialog. . does not have the keyboard focus. Other than that. Active: The hyperlink had keyboard focus. Hover: The mouse has paused over the hyperlink. and that the link appears underlined. a plain text link simply appears as plain text. There are four possible states of a hyperlink which you may format individually. The states are: • • • • Normal: The hyperlink is unvisited. The dialog which appears contains a check box which specifies that you wish to override the default browser settings (to undo your customizations at any time. and the mouse is not over it. The normal browser behavior is to display a dotted rectangle around it.

e. but HTML uses hex). i.. i. that this will be supported only by CSS 2. such as desktop color. if the color depth is not set to 24 or 32 bit. Remember that should you choose an item from the Standard Colors dropdown. none. over-line (line above). there may be color substitutions. or bolder. lighter. .” • Text Decoration: this provides simple text effects. upper case. • • Font Style: normal or italic. prepended with a zero.0 compliant browsers (browser versions 5. table.. Note that “bold” is provided for via Font weight. capitalize. • Text Transformation: this provides simple character formatting options. and inherit (from whatever tag this tag is embedded in. underline. lower case.e. Font Weight: note that this setting is comparative to the default browser font settings. Please note also that in some browsers. in blue-green-red order. Select a color from the boxes or specify a custom color. bold. i.. line through (crossed out) and blinking text. and in most operating systems. from any page. etc. Choose from normal. in the default template).e.x and higher). and followed by an ‘h.182 CLARION/PHP User’s Guide The formatting options for each of the above categories are as follows: • Color: provides access to the Color picker dialog. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal.

Note: to choose no color. Remember that your browses and forms will be placed on top of the background. To specify that the body should fill the maximum width of the browser window (or of the frame. Background Color: choose a color from the color picker. enter 100%. or from extra-small to double-extra-large. therefore don’t select clashing colors. This tab presents the following options: • Width: specify a value either in pixels (the number you wish.CLARION/PHP User’s Guide • 183 Font Size: note that this setting is comparative to the default browser font settings. right or center. Choose from larger or smaller. than your forms will be no wider than 400 pixels. If you set the body to only 400 pixels wide. or. delete any value in this box. Body Tag Tab The body style is particularly important in that it sets the width plus other major aspects of the “background area” in which the browses and forms will display. or type COLOR:NONE. Text Alignment: choose left. should you place the generated PHP page inside a frame). as a percent. followed by “px” without the quotes. • • .

Tahoma comes with Microsoft Office. Times. and thus present on even more machines than Tahoma. and is distributed with Internet Explorer. the formatting options must be limited to what the majority of browsers will support. You can specify anything in such a font list. then it checks for Times. Small bits of text such as headlines. such as Times. traditionally. Clarion/PHP adds Tahoma and Verdana to these. given the penetration of the Windows platform. generic font lists can be specified. but in the real world. most font lists have settled on a few Windows names such as Arial and Times New Roman. which stand out best for being “cleaner. They make fonts more readable. Serifs are the small hooks and curls at the ends of individual letters in some fonts. .” without the hooks. The end user may not have the same font. which is used in the section headlines in this document. For example: “Times New Roman. because the browser may not be on the Windows platform.” For web development. what has generally transpired is that you provide a list of fonts separated by quotes. then it checks the browser preferences for the default serif font.e. of which there will certainly be one. In the print world. If there is still no match. Verdana was specially designed as a screen font (i. are usually composed in a sans-serif font such as Helvetica. such as articles usually are printed in a serif font. which is what this paragraph uses. You should not even presume that fonts that are standard with Windows. Therefore. large portions of text. If not. and so is present on many machines. Sans-Serif.” The browser checks to see if Times New Roman is present on the system. it looks good at low resolutions).184 • Font Button: CLARION/PHP User’s Guide Whenever you choose a font for web content. Note: “sans” is French for “without. A web developer can’t simply choose a font from their machine and specify it for a page element. the theory being that the hooks and curves help the eye move from letter to letter in a quicker motion.. such as serif or sans serif. such as Arial or Times New Roman will exist on the browser.

but HTML uses hex). monospace.” • • • • Style: choose normal or italic.” “Arial. Weight: choose lighter. The choice lists are: “Verdana. Courier. Times. Remember that should you choose an item from the Standard Colors dropdown. prepended with a zero.” “sans-serif.” You will see the Font dialog at many points within the style sheet editor.0 compliant browsers (browser versions 5. that this will be supported only by CSS 2. top of page. Helvetica.x and higher).” or “monospace. Size: choose smaller or larger. Sans Serif” “Times New Roman. Select a color from the boxes or specify a custom color. Helvetica.” “serif. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal.” “Courier New. Please note also that in some browsers. and followed by an ‘h. and left/right sides of the page. You may choose a value from zero to ten in pixels for each side. bottom of page.” “Tahoma. Family: as described above. and in most operating systems. Helvetica. in blue-green-red order.CLARION/PHP User’s Guide The following options are present in the Font dialog: • 185 Color: provides access to the Color picker dialog. Arial. . bold or bolder. Sans Serif. Arial. • Margins Button: The margins button sets up the spacing on the side of the text. if the color depth is not set to 24 or 32 bit. Sans Serif.” “cursive. or between extra-small to double-extra-large. there may be color substitutions. such as desktop color. Serif.

and followed by an ‘h. Please note also that in some browsers. this tab sets the base options for the tables which display your data. prepended with a zero. followed by “px” without the quotes.0 compliant browsers (browser versions 5. Select a color from the boxes or specify a custom color. that this will be supported only by CSS 2. in blue-green-red order. and in most operating systems. but HTML uses hex). as a percent for the data background area. This tab presents the following options: • • Width: specify a value either in pixels (the number you wish.x and higher).” . in other words. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal.186 CLARION/PHP User’s Guide Background Class Tab The “class” refers to the browse and form tables. there may be color substitutions. Remember that should you choose an item from the Standard Colors dropdown. or. Color: provides access to the Color picker dialog. if the color depth is not set to 24 or 32 bit. such as desktop color.

Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. column headers.” . Each of the buttons leads to additional options appropriate to formatting each of the elements in turn. footer area (for navigation) input labels (prompts). as a percent for the actual data area of the HTML table. Within this tab are buttons that format all the data elements: header (a header for the entire table). • Width: specify a value either in pixels (the number you wish. • Color: choose a color from the color picker. described previously. Placing tables within tables is a solution to the limited page layout possibilities of HTML. and inputs (the entry boxes and data controls themselves). or. in blue-green-red order. Remember that your browses and forms will be placed on top of colors selected previously for other elements.CLARION/PHP User’s Guide 187 Data Tab All your data is presented as a table within a table. but HTML uses hex). data rows. followed by “px” without the quotes. governs the outside table. prepended with a zero. Therefore the Data tab is particularly important in that it provides the most immediate place setting for your data. and followed by an ‘h. The Background Class. therefore don’t select clashing colors.

. Style: specify dotted.0 compliant browsers (browser versions 5. that this would be supported only by CSS 2. double. Please note also that in some browsers. Color: provides access to the Color picker dialog. thick. outset or none. specifying: • • • Width: specify thin. You may format the top. dashed. there may be color substitutions. such as desktop color. if the color depth is not set to 24 or 32 bit. Select a color from the boxes or specify a custom color. groove. ridged.Data Tab This formats the rules (or lines) that surround the data grid. Remember that should you choose an item from the Standard Colors dropdown. inset. bottom and sides separately.x and higher). and in most operating systems. medium. solid. or zero to ten pixels.188 CLARION/PHP User’s Guide Borders Button .

Data Tab This sets interior margins for the data cells. Note that padding differs from margins.CLARION/PHP User’s Guide 189 Margins Button . Padding Button . You may choose a value from zero to ten in pixels for each side. in that padding values may be added to the normal height and width values for the particular element. whereas margins may not. bottom. the browser. depending on the element and possibly. . You may choose a value from zero to ten in pixels for each side.Data Tab The margins button sets up the spacing on the side of the data grid. top. and left/right sides.

Please note also that in some browsers. Padding (button): set the inside padding for left. if the color depth is not set to 24 or 32 bit. there may be color substitutions. prepended with a zero. right. and followed by an ‘h. right. You may set the following options: • Background Color: provides access to the Color picker dialog. . Select a color from the boxes or specify a custom color. in blue-green-red order. style. Font (button): choose the color.” • • • Text Alignment: choose from left. top and center in pixels from zero to ten. or center. weight.190 CLARION/PHP User’s Guide Header Button . and in most operating systems. but HTML uses hex). that this will be supported only by CSS 2. in effect being the place in which the data grid’s “title” appears. This dialog is identical to other padding choices dialogs throughout the style sheet editor. This dialog is identical to other font dialogs throughout the style sheet editor. size and family from the dialog.0 compliant browsers (browser versions 5. Remember that should you choose an item from the Standard Colors dropdown. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal.Data Tab The header is the equivalent to a caption bar area.x and higher). such as desktop color.

Padding (button): set the inside padding for left. in blue-green-red order. top and center in pixels from zero to ten. style. but HTML uses hex). This dialog is identical to other padding choices dialogs throughout the style sheet editor. . Please note also that in some browsers. right. that this will be supported only by CSS 2.Data Tab The column label is the header at the top of each column. if the color depth is not set to 24 or 32 bit. and followed by an ‘h.0 compliant browsers (browser versions 5.” • • • Text Alignment: choose from left. This dialog is identical to other font dialogs throughout the style sheet editor.CLARION/PHP User’s Guide 191 Column Label Button . Select a color from the boxes or specify a custom color. such as desktop color. and in most operating systems. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. or center. prepended with a zero. Remember that should you choose an item from the Standard Colors dropdown. right. functioning as the place where you name the column. Font (button): choose the color. You may set the following options: • Background Color: provides access to the Color picker dialog. there may be color substitutions.x and higher). size and family from the dialog. Note that Clarion/PHP automatically adds an up/down arrow on the sorted column to indicate the sort order. weight.

Note that these row styles can be applied to individual cells via conditional column formatting.Data Tab Clarion/PHP allows you to optionally format rows based upon either an odd/even order (improves readability). The first step is to create your style option names. Within the browse properties. for example. if you wish to create a style with a red background and yellow letters. Then. usually based upon the value in a particular column. You must name each style option within this dialog (you may think of this as a style name for each condition). you’ll require a third data row style. Delete: press Delete to delete an existing name. you may specify it here. • • • Insert: press Insert to create a new name. The first style named in the list within this dialog acts as the default formatting should you not set a condition within the browse. Therefore. thus. or upon a conditional test based upon some value you define. you specify the different style as a conditional style. you must define at least two styles so that one can “stand out.” If you expect to use a greenbar effect. Properties: press Properties to edit an existing name. you will set the conditions and choose the conditional style. when you wish either a row or cell to stand out based upon a data value.192 CLARION/PHP User’s Guide Data Rows Button . . but want to make selected cells or columns stand out. and set the formatting options here.

” • • • Text Alignment: choose from left. Select a color from the boxes or specify a custom color. Please note also that in some browsers. Grid Line Size: sets the lines within the data grid. Font (button): choose the color.x and higher). there may be color substitutions. Padding (button): set the inside padding for left. or center. if the color depth is not set to 24 or 32 bit. top and center in pixels from zero to ten. Choose between zero and nine pixels. and in most operating systems. style. and followed by an ‘h. This dialog. . weight. right.CLARION/PHP User’s Guide • • 193 Up/Down: you may use the up and down arrow buttons to move a style name into the first position. Background Color: provides access to the Color picker dialog. Within the Properties for each of the style option names.0 compliant browsers (browser versions 5.is identical to other font dialogs throughout the style sheet editor. size and family from the dialog. This dialog is identical to other padding choices dialogs throughout the style sheet editor. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. but HTML uses hex). in blue-green-red order. which is the one that acts as the default. Remember that should you choose an item from the Standard Colors dropdown. prepended with a zero. such as desktop color. that this will be supported only by CSS 2. right. you may set the following options: • • Name: this allows you to rename the style option name.

and in most operating systems. This dialog is identical to other font dialogs throughout the style sheet editor. size and family from the dialog. that this will be supported only by CSS 2. top and center in pixels from zero to ten. style.0 compliant browsers (browser versions 5. . such as desktop color. This dialog is identical to other padding choices dialogs throughout the style sheet editor.” • • • Text Alignment: choose from left. but HTML uses hex).194 CLARION/PHP User’s Guide Footer Button: Data Tab The footer provides the background area at the bottom of the data grid or form. there may be color substitutions. right. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. Select a color from the boxes or specify a custom color. upon which the navigational controls appear. if the color depth is not set to 24 or 32 bit. or center. in blue-green-red order. right. weight. prepended with a zero. Padding (button): set the exterior padding for left. Font (button): choose the color. You may set the following options: • Background Color: provides access to the Color picker dialog. and followed by an ‘h.x and higher). Please note also that in some browsers. Remember that should you choose an item from the Standard Colors dropdown.

or center. You may set the following options: • Background Color: provides access to the Color picker dialog. Please note also that in some browsers. top and center in pixels from zero to ten. In both cases. that this will be supported only by CSS 2. view only forms. there may be color substitutions. in blue-green-red order. the style sheet does not format the control. In other words. and followed by an ‘h. right.CLARION/PHP User’s Guide 195 Input Label: Data Tab The input label is the prompt for your update form data controls. The control will take on the appearance of whatever the host operating system specifies for that type of control. The background of the cell in which the control is contained will adopt the appearance of the formatting options you place here. you can’t specify the font/style/color of the text the user types inside an edit box. you will specify .” • • • Text Alignment: choose from left. Select a color from the boxes or specify a custom color. right. prepended with a zero. For an update form.x and higher). the formatting affects the HTML table cell. size and family from the dialog. Padding (button): set the exterior padding for left. weight. Remember that should you choose an item from the Standard Colors dropdown. This dialog is identical to other padding choices dialogs throughout the style sheet editor. if the color depth is not set to 24 or 32 bit. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. but HTML uses hex).0 compliant browsers (browser versions 5. This dialog is identical to other font dialogs throughout the style sheet editor. the table cell contains not text but an HTML control. and in most operating systems. such as desktop color. style. Input: Data Tab The input formatting options work differently for update forms vs. Font (button): choose the color.

appears for data in update forms for three reasons: for consistency. if the color depth is not set to 24 or 32 bit. This dialog is identical to other padding choices dialogs throughout the style sheet editor. style. size and family from the dialog. and followed by an ‘h. Note that the color value returned by the picker will be hexadecimal (the Windows Color Picker uses decimal. You may set the following options: • Background Color: provides access to the Color picker dialog. prepended with a zero. Select a color from the boxes or specify a custom color. Please note also that in some browsers.196 CLARION/PHP User’s Guide the background color outside the edit box. which dispense with the control and simply print the data in the cell.x and higher). such as desktop color. The option of formatting color. and in most operating systems.0 compliant browsers (browser versions 5. Remember that should you choose an item from the Standard Colors dropdown. right. Padding (button): set the exterior padding for left. top and center in pixels from zero to ten. This dialog is identical to other font dialogs throughout the style sheet editor. This applies to update forms only. weight. there may be color substitutions. for those who wish to edit the cell after generating the PHP page. the html places text formatted exactly to your specifications.” • • • Text Alignment: choose from left. etc. that this will be supported only by CSS 2. in blue-green-red order. For viewonly forms. and most importantly. . Font (button): choose the color. but HTML uses hex). right. or center. for View Only forms and fields.

alignment. Help: sets the style sheet choice for help text windows should the procedure not override. The choices to implement within this dialog are as follows: • • • • Global: sets the global style sheet choice if no other choice is set.CLARION/PHP User’s Guide 197 Style Sheets After defining at least one style sheet. and those provided under HTML 4. Desktop developers may have to make a slight adjustment in their thinking in regards to differences between those controls allowed by the Windows operating system. . List: sets the style sheet choice for browse procedures should the procedure not override. they will not apply unless you link the style sheet and use the style names. Form: sets the style sheet choice for update and query procedures should the procedure not override. As you will note in the chapter that documents the Style Sheet Editor. We have tried to highlight the most major differences in this chapter on the Style Sheet Editor. then very close to it. style. you may press the button and choose your default global styles from the dropdown boxes. Such a task is much easier with an HTML editor than using a text editor. though should you create your own HTML help pages. You may override the choices within each procedure. Clarion/PHP allows you to customize the appearance of each individual element to if not the maximum allowable with HTML.0 standards. The style sheets specify color. and sizing for each of the components which appear in the generated pages.

198 CLARION/PHP User’s Guide .

....................................................................105 embed point........................................... 71 Clear Filter.......................................................................................................................91 Create this as a Link.... 148 application wizard...... 71 Builder page ..................................... 133 Back Button ....................................................7 Control Location ..........................................................79 Display Column ............................................... 149 child browse ........................................................................................................133 Custom Link...................................... 60.............. 92 Add Procedure ................. 132 Additional Parameters........................................................97 Default Cell Style ...........................................................................................................................134 Custom Controls.......................................... 99. 144 Calendar Popup ..................................................................................... 130 column label ..........................................................................................................154 Cookies.................................. 7 CDONTS .......... 115............................70 Delete Row ............................. 132 Administration............................................. 92 client side validation .....................128.... 150 Caption ............ 185 Column Header Text ...................................................................................128.............................114 connection builder ...............................12 Edit ..................100 Connection Builder ......153 custom link............................................................142 Delete Form............................................................. 135................................... 122 Additional Cell Style .........142 email ..................................119 Combo Options...........................................................153 do not populate.................114 Default SQL ........................................... 64 Browse to Browse ................91 Data Row............ 61.... 93 Cannot be Null ........................ 124 access level..................... 149...................... 155 <a> .14 connection object ....... 113 Browse template ................ 179 Alignment .............. 129 <A>..... 80 Cascading Style Sheets ..................132 ..........................................................................................................................................191 Column Name.................................100 connection string ............................................................................. 44 Color picker dialog ....... 128 Additional Row Style ..............128 Create Detail Link........................... 155 <br> .........................140 Email............9............................................. 121 Clear Filter Prompt ...........CLARION/PHP User’s Guide 199 Index: ?WHR.......................................... 108 checkbox on query form....................11 Data Records per HTML List...... 44.................................132 Column With Value to Return.................................154 Create this Column as Link ............................................................... 55 Debug mode ............................. 183 Borders........................................... 63.................................................................44............................................................ 56............... 154 cascading style sheets .............................................114 Conditional row formatting..................................................................... 130 Automatic Detail Link ..... 179 Appearance .........................................................................134 Column to Test ..................................122 Delete .............154 Control Name .................... 107 ADO.... 107 Alert Text Message ... 59 Actions tab................................... 9 Ascending/Descending Sort........132 database dictionary .145 Enable Cell Style ..... 134 All Data...................................................9 Do Not Populate ................................. 12.......................... 112.............105 Create column as a Link...........132 Default Row Style ................................................. 150 Client/Server........................107 E-Mail .. 121 ALT text ...... 142 Add Button..... 151 alignment................................. 91 Annotated Examples ................................... 188 Browse extension template ...................153 conditional row formatting ......................................................................................... 88 Background Class ..........................123 data dictionary ...147 Design Time HTML Template ................. 131. 154 Data Columns.............. 84 Connection Properties............................................................................... 186 Body Tag ............ 155 Data Column to Pass ................................

.................................................. 145 Help ................ 83................ 59 HTML design time template ..............150 Northwind sample database.... 74 My Records ................................................................92 Locator.............................................. 13 File Drop Lists ............. 94 Form Defaults..... 138 form fields..........................200 Enable Security .......................................... 181 HTML controls .....116...... 179 formatting tags................................................................................................................................................. 99 Help URL.............. 14 HTML editor......................................................... 150 Navigation Bar ............................................................................ 96 formatting .............................................................. 95 Form Validation ........................................ 63 Global Template ..... 75........ 75...................................................... 118 Hover.......... 115 header ................ 114............................................................................................................151 Must be in List ............................................................................................. 79 Hyperlink ............. 95 Form Primary Table .....................................136.... 93 form extension.....................................................................109 Include in the SQL Select But Do Not Display ............................................................ 146 form template ........................................................... 152 HTML Form Element.... 51 generation .....153 margins................121 link ...............................................................................96 Must Be In List......................... 133 Link ... 130 Enhanced ADO Error Reporting......... 156 Image Sizes... 179 Generation......................................................................................................................................................................................... 97....................................................................... 179 Formatting Function ..............................12 JOIN .......................................... 7.......................................................119......................................................................... 135 hyperlink colors ......................................................68 links ................................ 80..... 83 HTML run-time template .............................................. 13 file loaded list box.....................58....................................................... 184 Font .96 Omit From QBF Page.......142 ISAM databases ...... 140............................71...................................... 87 global extension template ................................126 Include With Prior Column.................... 65 Form Titles ............... 132 formatting options......... 123 key ................. 179. 57 HTML template....185.............................................. 189 Maximum Characters ... 51 list defaults................. 115................................................11 Javascript ............................... 85........7....................136............................ 141............... 81 Form Message Text ...............................151 Lookup SQL........................................................................150 Must be in table ....................................................................56................... 190 help.......................... 14 global template .....................................................................................................125 No Records Found ............150 merge ... 59....................................................... 152 font ........120 Login Screen Text ....... 149 HTML Pages ...................90 localhost ......................... 181 CLARION/PHP User’s Guide ID Value Column ................... 156 Image Column ........................................79 Must Be In File...................................................65 Key to Pass . 116 Enable Sorting by this Column.......136 Image Button ..........................................15 Must be in Table ... 98 HTML parameter ..................................................................................................................................92 No Validation .....................................195 Insert...77 Location .................................................149 Order clause ........................................................................................... 59............................... 154 Field Lookup Buttons ............. 148 Numeric Field ......................... 79 HTML Element ..................... 60... 75 Help Link ..........................................................106 Lookup. 88 Help Pages.............................91 nbsp......................126 input label ........56 Images.....................................................................................................................................134 locator.................................................123 .........................128 LIKE..........11 Key ................. 98 global extension ............................150 Must be in Numeric Range.... 108 Enter Display Text..................110 images ....... 182 Form Button Text ............................................................. 63 greenbar .........

70.... 105................... 128............................................... 60 security ....................................................................................................................................................................................144 template chains ............ 197 Style Sheet ..........................................59 token.... 100 scalable .............................. 122.............................................................. 116...133 Show Help ............................152 session variable..............................................................77 Test/Debug page................................ 128.............. 145 Query By Form Button ... 94..................................................... 96 resultset...................................182 timeout..................................................... 142 Search Mode ........ 80 runtime user ID............................ 147 SQL date/time field...................................................................................................................................... 98....... 118 parent browse..............128.......155 ............. 148 Primary File .............81 Target Column................................. 117 Security Level.............. 154 Processor page ................................. 154 Populated From................................................................ 119................................................................. 140 Session Variable to Pass .....................................................142 Status Text ................ 66 Range Limit ..................................................................................... 154 SESSION() .......125 SQL for Selection ....................................................................................... 67 Read Only ............ 144 Required Field ........... 110 popup window ..........44....................... 120 Procedure Link . 138 Padding .............................73....................................................................................... 113 Override.......84........................................... 119.............. 131 Populate ...................80 Tool Tip..................................13 test/debug page.. 103 security options...................................... 154 status message ......... 150 Run Time HTML Template.................60 Type of Procedure..59 select browse........................................................ 56 procs............ 145 Pass this Data .......................... 126 range select....htm..118 Select Options ................................ 154 Populate From....14 security scheme ............88 target page ...... 92 query form ............................. 143 Row Style .......................................................................88 TRN files............................................................................................................................................................ 77.................................... 94 secure http........ 149 read only form ............................................. 146 repeat add ...... 144 Processor Pages........................147 Standard Colors . 189 Page Naming Conventions .... 122........... 65 Primary Table ..... 154 pixels .................................................................. 60 Search ...................................... 71 Parent Browse...................................11 Tooltips ........95 style sheet ........ 60..................................................................156 target .................. 71..185 stateless ........182 Text Transformation ......... 143 Return to Filtered Browse .................................98 style sheet editor ........................ 151 Select Mode Procedure..............88 triggers....................................98 Text Alignment........................................57 Table With Image ................................................179 style sheets....CLARION/PHP User’s Guide override ........................................................................................................... 140 Security ................................................................................7.........183 Text Decoration .............155 shopping cart ..... 143 Regenerate SQL ..................................................................................144 status messages ..........................................107 smtp................................................................................................................................................................11 TRN file................................................................................. 11..................... 118 Query by Form ...........................................91 tooltips ..................................... 141 201 security model .........................153 Target Language .......................149 Tool Tips............................................. 145 Repeat Add Mode .............................................7........... 84 Page Title ........... 83 Static Entry ........... 44 return mechanism ................. 114.......................................................... 67........................ 118................ 136....128.... 123 popup calendar ..................................83 QBF Procedure ...................................................................................56.......88 Site Title...........108 SQL .............................................. 114 Rows and Columns ......... 99 precision ...............................................................

.......................131 window control types ..........................................................................................................142 View Form ................................ 70 URL ..........12 Window Size....................... 145 User Table.................................................93 web designer ................................................................. 56 User Based Security .............................. 60 Unique ID Column........................................................................................................................................ 153 Unique Key...........57..................123 Width ... 7 CLARION/PHP User’s Guide Value Column .................... 146 Update Form .............................................................................................................................155 view ................................ 68................................................................. 104 Validity Checks......... 104 user defined variable.................................98 ....153 VBScript................202 unencrypted..................... 179 Where clause......... 66 URL parameters...............................11 View.......................