Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #16717
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "J.O. Aho" <user@example.net> |
| Newsgroups | comp.lang.php |
| Subject | Re: Pagination isn't working |
| Date | Sun, 3 Apr 2016 10:30:43 +0200 |
| Lines | 30 |
| Message-ID | <dmc2lkFt3liU1@mid.individual.net> (permalink) |
| References | <super70s-3A8AC1.16045102042016@boina.datemas.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net W0odPhVEDDA2pyQ3pfPKHwXHLgLUYefx9pCVSIhI5L9ZngdHa0 |
| Cancel-Lock | sha1:DFXKNl243twVm/vNxkqUUHX42Sc= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
| In-Reply-To | <super70s-3A8AC1.16045102042016@boina.datemas.de> |
| Xref | csiph.com comp.lang.php:16717 |
Show key headers only | View raw
On 04/02/2016 11:04 PM, super70s wrote: > I have a little PHP article directory script with pagination at the > bottom, but it isn't working when you click on pages 2, 3, 4, etc., -- > it always shows the same 10 entries on the first page. Anyone have an > idea how I can fix this? > > </table><font class=bodylinks>Go To Page : > [1] > <a href="?pg=2&page=category&category_id=86" > class=bodylinks><strong>2</strong></a> > <a href="?pg=3&page=category&category_id=86" > class=bodylinks><strong>3</strong></a> > <a href="?pg=4&page=category&category_id=86" > class=bodylinks><strong>4</strong></a> > you need to add $this->ps to the variable you use for setting the ?pg= > if (!empty($_GET["ps"])) > $this->ps = (int) $_GET["ps"]; > else > $this->ps = 50; I wouldn't use empty() to verify that the user input is correct, use a regular expression or in worst case is_numeric() to validate the input. -- //Aho
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-02 16:04 -0500
Re: Pagination isn't working Richard Yates <richard@yatesguitar.com> - 2016-04-02 17:12 -0700
Re: Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-02 20:08 -0500
Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-03 09:46 +0200
Re: Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-03 14:05 -0500
Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-03 23:09 +0200
Re: Pagination isn't working Arno Welzel <usenet@arnowelzel.de> - 2016-04-04 11:35 +0200
Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-04 12:44 +0200
Re: Pagination isn't working "J.O. Aho" <user@example.net> - 2016-04-03 10:30 +0200
csiph-web