PHP Samples
------------
1 PHP Sample Files Purpose
2 How to Run PHP Samples in Windows
3 How to Run PHP Samples in UNIX


1 PHP Sample Files Purpose
---------------------------
    Sample: basic\odbc-t1.php

    Purpose: 
        The files odbc-t1.php, odbc-t2.php, odbc-t3.php, odbc-t4.php and
        odbc-t5.php are an example of DBMaker database basic function in
        PHP.


    Sample: poll\01demo.php

    Purpose: 
        This sample demostrates a simple vote system. You can select one of 
        the two option. The system return the results shows the percentage 
        distribution. 


    Sample: poll\voteadmin.php

    Purpose:
        This sample demostrates how to use PHP to develop database 
        application by an vote system example.


    Sample: register\user.php

    Purpose:
        This sample demostrates how to use PHP to develop database 
        application by an register example which records name, address, 
        telephone, etc. information.


2 How to Run PHP Samples in Windows
------------------------------------
    Install PHP:
        1. Now all Windows binaries can be used on Windows 95/98/Me and
           on Windows NT/2000/XP. 

           The binaries packaged as Windows installer to install and 
           configure PHP, and automatically configure IIS, PWS and Xitami, 
           with manual configuration for other servers.

           For details, please refer to 
 
             http://www.php.net/downloads.php


        2. After installation, you need to configure php.ini to run 
           the sample.
         . Rename php.ini-production to php.ini.
           If you already have php.ini, change error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT.
         . Set extension_dir = the extension DLLs directory.
         . Delete (;) before extension=gd and extension=odbc in php.ini.      
         . For further details, please read the README file with PHP package

    Execute:
        1. It is recommended to use the SYSTEM DSN instead of USER DSN.
           Register the ODBC DSN properly.

        2. Start dbsample5 with dmserver.

        3. Start php server and execute php samples. For example:
             % php -S localhost:8000 -t C:\DBMaker\5.4\samples\PHP

3 How to Run PHP Samples in UNIX
---------------------------------
    Install PHP:
        1. Install PHP on UNIX.
           Please refer to PHP.
             http://www.php.net/manual/

           Or use the following command:

             % apt-get install php
    
        2. Download unixodbc, php-odbc, php-gd.
         
             % apt-get install unixodbc
             % apt-get install php-odbc
             % apt-get install php-gd
    
        3. Use php -m command to check if odbc, gd is added into PHP's modules.
            
             % php -m
               [PHP Modules]
               gd
               odbc
          
        4. Add dbsample5 settings to odbc.ini and DBMaker driver to odbcinst.ini.
         
             odbc.ini
               [DBSAMPLE5]
               Descripton=dbsample5 database
               Driver=DBMaker 5.4 Driver
               Database=DBSAMPLE5
      
             odbcinst.ini
               [DBMaker 5.4 Driver]
               Driver=/home/dbmaker/5.4/lib/so/libdmapic.so
               UsageCount=1
    
    Execute:
        1. Use the following command to start database DBSAMPLE5.
             % dmserver dbsample5
         
        2. Start php server and execute php samples. For example:
             % php -S localhost:8000 -t /home/dbmaker/5.4/samples/PHP/
