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.

Featured Replies

Hi there, PHP gurus.

I'm using fm-and-php from schubec to integrate FMS8A into a website already built using php.

I want to build a form for users to submit a query, then get a display of records that match the query. Read only, so it seems like a really simple chore.

I have an html form that collects the one piece of information I want to search, and a form action page that returns the results in tabular format.

This is all swell, the trouble comes when I want to navigate from the first page of results to some other page of results. Using fm-and-php's built-in function of getListNavigation() gives me links to other pages, but when I use them, I lose my found set. Clearly, I need to resubmit the original query, along with the 'skip' value for the number of records to skip. But how?

Do I store it in some kind of global variable? Do I have to write it to a database somewhere? How do you do these things?

As it is my first effort at either web page construction or PHP work, I'm feeling a little lost. Yes, I'm going to the library to get a book on PHP, but that won't help with this specific problem.

Any help is appreciated.

Thank you in advance.

Without knowing anything about the "FM-AND-PHP" Class. You can still write the page links "< Prev", "Next >" etc. These would include the search term and the calculated off-set. However, some knowledge of PHP programming would be required (maybe after you read the book - tomorrow :)

Someone may have this already written and they may be willing to pass it on ;) , or the getListNavigation() function may have a good way of handling this (if only I could read German).

Good Luck.

Garry

  • Author

Solved!

I need to use a form method="GET" to encode the server query into the URL. That's probably a 'DUH' for experienced PHP folk, but I still don't get it.

fm-and-php seems to be ambivalent about which method is used, but I couldn't get it to work with "POST".

Hope that helps someone.

  • 2 weeks later...

Hi,

you need to add the parameter 'skip=x', where x is the number of records you want to skip and the line:

$FM->setSkip($_REQUEST['skip']);


to the fm-and-php query.



The parameter skip in your url is then read by the 'setSkip' function in fm-and-php.

That will skip 'x' records in your result.



Adding the commands:



echo $FM->getFoundCount() . " records showing " . $FM->getCurrNumShowing() .". 

";

echo $FM->getLinkFirst($label = "<< Start") . "  ";

echo $FM->getLinkPrevious($label = "< Prev") . "  Page:" . $FM->getListNavigation() . "  ";

echo $FM->getLinkNext($label = "Next >"). "  ";

echo $FM->getLinkLast($label = "End >>");

will add list navigation, automatically adding the 'skip' parameter to your url.

Hope it helps....

Reg Herrix

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.