NYCPHP Meetup

NYPHP.org

[nycphp-talk] (no subject)

John Randall jmr642 at yahoo.com
Sun Nov 17 09:49:46 EST 2013


You were right! The invisible field idea worked better than the session variable. It's working fine now. thanks again!



________________________________
From: Jeff Slutz <jeff at jeffslutz.com>
To: NYPHP Talk <talk at lists.nyphp.org> 
Sent: Friday, November 8, 2013 12:41 PM
Subject: Re: [nycphp-talk] (no subject)



One possibility: you could set the offset as an invisible field in your form.  Then after them form submission, when PHP gets the POST data, you can set the new offset field as the previously submitted offset plus one.  Know what I mean?


Best,

JS



--
Jeff Slutz 
JSLEUTH LLC

2105 N Fork Drive
Lafayette, CO 80026
c. 970.443.9390
jeff at jeffslutz.com


On Fri, Nov 8, 2013 at 9:57 AM, John Randall <jmr642 at yahoo.com> wrote:

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.
>
>
>
>
>_______________________________________________
>New York PHP User Group Community Talk Mailing List
>http://lists.nyphp.org/mailman/listinfo/talk
>
>http://www.nyphp.org/show-participation
>


_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show-participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20131117/3042688c/attachment.html>


More information about the talk mailing list