Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6057 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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?

  • Newbies
Posted

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...
Posted

<?

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 (?>)

This topic is 6057 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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