NYCPHP Meetup

NYPHP.org

[nycphp-talk] (no subject)

Chris Snyder chsnyder at gmail.com
Fri Nov 8 12:41:47 EST 2013


if I understand the situation correctly, you probably want <input
type="hidden" name="offset" value="$new_offset"> to pass the variable, and
an <input type="submit" value="Get the Next 10"> to submit the form.

Since you're doing GET requests, you could just use a link instead of a
button. <a href="?offset=$new_offset">Get the Next 10</a>  You could even
style the link to look like a button.




Chris Snyder
http://chxor.chxo.com/


On Fri, Nov 8, 2013 at 11: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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20131108/432b3248/attachment.html>


More information about the talk mailing list