コード例 #1
0
ファイル: index.php プロジェクト: SmartPCGuy/fxphp
 $DatabaseData = $FXQuery->FMDBNames();
 // The '->' indicates that SetDBData is part of
 // the FX instance we just created.
 if (FX::isError($DatabaseData)) {
     echo "<pre>\n";
     print_r($LayoutData);
     echo "</pre>\n";
     exit;
 }
 foreach ($DatabaseData['data'] as $key => $value) {
     $currentDatabaseList[] = $value['DATABASE_NAME'][0];
 }
 unset($DatabaseData);
 if (in_array($FXE_currentDatabaseName, $currentDatabaseList)) {
     $FXQuery->SetDBData($FXE_currentDatabaseName);
     $FXQuery->SetDBPassword($FXE_password, $FXE_username);
     // Note that password is the FIRST parameter (since user names are only relevant for the FM Web Security DB.)
     $LayoutData = $FXQuery->FMLayoutNames();
     if (FX::isError($LayoutData)) {
         echo "<pre>\n";
         print_r($LayoutData);
         echo "</pre>\n";
         exit;
     }
     foreach ($LayoutData['data'] as $key => $value) {
         $currentLayoutList[] = $value['LAYOUT_NAME'][0];
     }
     unset($LayoutData);
     if ($FXE_currentLayoutName == '' && strtolower($dataSourceType) == 'fmpro5/6' || in_array($FXE_currentLayoutName, $currentLayoutList)) {
         $errorMessage = 'None';
         if (strtolower($FXE_action) == 'update') {
コード例 #2
0
ファイル: index.php プロジェクト: SmartPCGuy/fxphp
}
# END MICROSOFT IIS TWEAKS
# Grab the FMErrors file for dynamic error reporting
require_once $_SERVER['DOCUMENT_ROOT'] . "/FX/Developer/FMErrors.php";
######## !!! Welcome to PHP, the FX.php Class and the FX Parser !!!! ###########
#  	BEGINNING OF USER CODE HERE
#  	This area is for you to change so the FileMaker query matches your own query.
#  	Use the FX Class documentation for understanding more about this process...
#
#  	To make the FX class work, the FX folder must be at the root level of your
#  	site, and you must INCLUDE the FX class into this page like this:
require_once $_SERVER['DOCUMENT_ROOT'] . "/FX/FX.php";
#  	You start your query by creating a new instance of an FX Class and assigning
#  	it to a variable.
$query = new FX(your_serverIP, 80, 'FMPro7');
#  	Using the same variable call the SetDBPassword (if necessary) using the pass-
#  	word and username that has the fmxml extended privilege.
$query->SetDBPassword(your_password, your_username);
#  	Using the new variable $query, call the SetDBData function, specifying which
#	FMP file, layout and how many you want in the returned set (this example
#	shows how to limit the result record set to 3).
$query->SetDBData(your_fm7File, your_layout, 3);
#  	Using the same variable call the AddDBParam to specify your serach criteria,
#  	passing it the field name and the match content (you can repeat this function
# 	as many times as you wish to add find requests).
$query->AddDBParam(your_fieldname, your_find_criteria);
#  	If you want to sort the result, us the AddSortParam  function and specify  the
#  	field and  the direction  (ascend/descend) of  your sort (you can repeat this
#  	function as many times as you wish for each sort request).  Uncomment this
#	this function line and add your field name to sort your find results.
#   $query->AddSortParam(your_sort_field_name, 'ascend');
コード例 #3
0
The more fields and the bigger then content, the slower the query.

For the purpose of bandwidth distribution it is not desirable to make the total space more narrow than it already is.


A typical real world example below
*/
$tmpStaticFile = 'http://www.example.com/xml/order/' . $o . '.fmpxmlresult.xml';
if (uriexists($tmpStaticFile)) {
    $q = new FX($tmpStaticFile);
    $q->FMFOpenQuery(true);
} else {
    $q = new FX($dinnerForOne, $sandeman);
    $q->SetDBData('WorldWideWait', 'xmlOrderStatusFlag');
    $q->AddDBParam('ordernumber', $_POST['ordernumber'], 'eq');
    $q->SetDBPassword($xmlPass, $xmlUser);
}
$r = $q->FMFind();
/*

uriexists implementation below:
*/
function uriexists($uri)
{
    // $o = output
    // $e = error code
    // $ch = cURL handler
    $ch = curl_init($uri);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_exec($ch);
    $e = curl_getinfo($ch, CURLINFO_HTTP_CODE);