Jump to content

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

Recommended Posts

Posted

I have a simple form which queries a database with thousands of records. The form takes twenty inputs, too much for using GET (the URL is about 500 characters long). POST works great. I want to show 50 records at a time and jump from group to group. The search part works fine.

I use the 'Link Next' and 'Link Previous' commands on the search results page. When I click them, I get zero records.

How do I get the page to remember the found set but advance the $skip setting when POST is used? (It worked great with GET before the URL got too long.)

I have explored every resource I can find, but aside from Chris Hansen's FXExamples.php (which is not a form), I cannot find an actual example which parallels my situation or even uses these Link commands. Does anyone have the code of an (ANY!) example of this that you could include in a response?

I can't wait to get my hands on VisualFX for Dreamweaver so I can see how this code is supposed to work!

With appreciation,

Dave

Posted

You can use the CURL functions to POST from PHP. For example:

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:1154/FMPro");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, "-db=combotest.fp5&-format=-fmp_xml&-findall");

curl_exec($ch);

curl_close($ch);

?>

Hope this is of interest.

Garry

p.s. I've just realised that you want to do the POST from the page. You may have to build a Form with [FMP-CurrentFind] and some Javascript.

Posted

Garry,

Thanks, as always, for your reply. I was on vacation. Sorry for delay in getting back.

I made use of your idea in the P.S. I built forms for linkNext and linkPrevious which submit the last stored POST query with an updated (calc) skip entry. Buttons instead of links. Works great.

I always learn something from your responses. Thanks for the push!

Dave

This topic is 7490 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.