Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

URL to Execute Find in PHP or IWP?

Featured Replies

  • Newbies

How do you compose a URL that will execute a find on one or more fields when it is published using PHP (or IWP)?

I can't find any doumentation on this and I haven't had luck googling it; so please feel free to recommend the books that reveal the secret.

I published a PHP site using the PHP Site Assistant and its find works, but the resulting URL only reveals the following:

"http://somesite.net/PHPSite/test/recordlist.php"

However, clicking the Find All link reveals the following URL:

"http://somesite.net/PHPSite/test/recordlist.php?-skip=0&-db=TestDB&-max=20&-lay=TestLayout%20live&"

What would I have to add to the URL if I wanted to create a static link that would find specific criteria?

E.g. Show Bob Smith's Transactions (find by Bob's customer ID).

Likewise, I was trying to do this in IWP, as well (whichever I could figure out first). Of course the normal IWP URL looks like this:

"http://shark.eas.sjsu.edu/fmi/iwp/cgi?-db=FMServer_Sample&-loadframes"

But when in IWP find mode I opened the data frame in a new window and saw all these other options on the address bar:

"http://shark.eas.sjsu.edu/fmi/iwp/cgi?-index=27&-recid=1&-relatedrecid=1&-buttonscript="

Unfortunately, the server does not like being fed this URL directly. Are there any sort of URL options IWP will accept to execute a find from a static URL link?

  • Author
  • Newbies

Well, I haven't got an answer yet, but I found some clues for composing the PHP query in a static URL.

FileMaker's "CWP with PHP" and "IWP" PDF documents reveal nothing about URL options, but Appendix A query parameters of their "CWP with XML" documentation

http://www.filemaker.com/downloads/pdf/fms9_cwp_xslt_en.pdf

compares closely with the form post method I found in the results from the findrecords.php generated by the PHP site assistant.

CustomerIDField

Contains

Begins With

Ends With

Equals

Not Equals

Less Than

Less Than or Equals

Greater Than

Greater Than or Equals

Please let us know if you discover anything further.

  • 2 weeks later...

<?

require_once ('FileMaker.php');



$fm = new FileMaker('DB_Name', "http://fmserver.com","USER", "PASSWORD");



/**

If you use PHP's Global $_REQUET Array CustomerID value can be passed either 

as a GET in URL http://mysite.com/myFMP_PHP_APP/getCustTrans.php?CustomerID=val

or from a POST form element with name="CustomerID"



To pass multiple elements in the URL place an & between them

http://mysite.com/myFMP_PHP_APP/getCustTrans.php?CustomerID=val&StoreID=val&maxPrice=val

**/



$found_set = $fm->newFindCommand('CustomerTransactionLayout');

$found_set->addFindCriterion("CustomerID", $_REQUEST['CustomerID']);

$result = $found_set->execute();

if (FileMaker::isError($result)) {

    echo "Error: " . $result->getMessage() . "";

    exit;

}

$records = $result->getRecords();



?>

HTML to describe / label found set

<?

foreach($records as $record){

?>

HTML for each record in found set

<?



}

It's odd that the code tags strip out the php closing tags (?>)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.