Exemplo n.º 1
0
// If you use version 6 pro/unlimited, modify to 'FMPro5/6' from 'FMPro7'.
//$BookQuery->SetCharacterEncoding('utf8');	// Added by msyk 2004/3/23
// These lines pass the character set information to FX class.
//$BookQuery->SetDataParamsEncoding('SJIS');
// If you use version 6 pro/unlimited, you need this statement.
//If you want to use UTF-8 only, you don't need to abve methods for FX_charset class.
$BookQuery->SetDBData("Book_List.fp7", "Detail_View");
// The '->' indicates that SetDBData is part of the FX instance we just created.
$arrayName = 'HTTP_' . $HTTP_SERVER_VARS["REQUEST_METHOD"] . '_VARS';
// Note the '$$' a couple of lines down.  I'm using a variable
// whose name is the contents of another variable.  VERY handy.
// **** Added by msyk 2004/3/23 **** To make a new record in DB.
if (${$arrayName}['currentQuery'] == 'New Record') {
    foreach ($HTTP_POST_VARS as $key => $value) {
        if ($key != 'currentQuery' && $key != 'currentSort') {
            $BookQuery->AddDBParam($key, stripslashes($value));
        }
    }
    $BookQuery->FMNew();
}
//$BookQuery->SetDBData("Book_List.fp7", "Book_List");
// The extension in the file name omited for multi version compatibility(msyk)
if (${$arrayName}['currentSort'] != '') {
    // If sorting has been requested, this adds it to the query.
    $BookQuery->AddSortParam($HTTP_GET_VARS['currentSort']);
}
if (${$arrayName}['currentQuery'] == 'Search Book List!') {
    // Check if this page is being accessed by a search
    foreach (${$arrayName} as $key => $value) {
        // 'foreach()' is a VERY handy function.  It steps
        // through an array and stores the data in temporary
Exemplo n.º 2
0
 * under The Artistic License of PERL fame:						  *
 * http://www.opensource.org/licenses/artistic-license.html		  *
 *********************************************************************/
/* Modified by Masayuki Nii (2004/8/13), for adding Japanese field name support. */
header('Content-Type: text/html;charset=EUC-JP');
// Added by msyk 2004/8/13
// For avoiding MOJI-BAKE( invalid character ), please saving this file by EUC chacter set.
// このファイルはEUCで保存して利用してください。
include_once 'FX_charset.php';
// FX.php contains the class for pulling data
// from FileMaker into PHP -- 'include_once()'
// makes sure the class is only declared once.
include_once 'server_data.php';
// To make sure that these examples work for you, be sure
// to set the IP address of your server in server_data.php
// IMPORTANT: The leading '$' denotes a variable in PHP
$BookQuery = new FX_charset($serverIP, $webCompanionPort, 'FMPro7');
// This line creates an instance of the FX class
// If you use version 6 pro/unlimited, modify to 'FMPro5/6' from 'FMPro7'.
$BookQuery->SetCharacterEncoding('EUC-JP');
// Added by msyk 2004/8/13
$BookQuery->SetDataParamsEncoding('UTF-8');
$BookQuery->SetDBData("Book_List", "Detail_View");
// The '->' indicates that SetDBData is part of the FX instance we just created.
$BookQuery->AddDBParam('-recid', $HTTP_GET_VARS['ID']);
// '-recid' is a reference to the unique ID that FileMaker
// creates for each record.  You'll also note that PHP
// recognizes the parameters passed from the last page ('ID').
$query = $HTTP_GET_VARS['query'];
$BookData = $BookQuery->FMFind();
$currentKey = key($BookData['data']);