NYCPHP Meetup

NYPHP.org

[nycphp-talk] (no subject)

John Randall jmr642 at yahoo.com
Fri Nov 8 11:57:31 EST 2013


I am fairly new to php and Javascript, as well as new to this list. 
 
I have a query to Solr using php, which works fine. I use a form page, with <form method= GET and an <input type = submit to activate the query, sending the first 10 hits to a table on a separate results page. However, on the results page I would like to add a button (type=submit or type=button) that would retrieve the next set of 10 records. On the results page, I set the $limit variable to 10 and this remains fixed, because I only want 10 records at a time.  I set the $offset variable to 0 for the first set of results and try to increment it  by 10 for the next set ($offset +=10;). However, as I understand html, once the results page is rendered, the $offset variable dies, so it cannot be incremented.
 
I've tried making $offset global, but without success. 
I've tried using <input type=button with a JavaScript function to increment $offset, but it doesn't seem to remember the previous value.
 
Does anyone have any ideas? Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20131108/d57bb09a/attachment.html>


More information about the talk mailing list