Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: Pagination isn't working Date: Mon, 4 Apr 2016 11:35:51 +0200 Lines: 55 Message-ID: <57023577.6020103@arnowelzel.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Trace: individual.net QWSCSRz3ch+km/6YT9sfnA4GgDGkYUrV7r1GiquAT7Kum1yOQU Cancel-Lock: sha1:YhN/k+96+hrp45ZvJX9O0ZoEVak= In-Reply-To: Xref: csiph.com comp.lang.php:16720 super70s schrieb am 2016-04-03 um 03:08: > In article , > Richard Yates wrote: > >> On Sat, 02 Apr 2016 16:04:51 -0500, 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? >>> >>> Go To Page : >>>   [1] >>>  >> class=bodylinks>2 >>>  >> class=bodylinks>3 >>>  >> class=bodylinks>4 >> >> You have not shown any php code, particularly what is done with >> "?pg=x". > > I came up with a quick & dirty workaround, I changed 10 to 50 in > func.php... > > if (!empty($_GET["ps"])) > $this->ps = (int) $_GET["ps"]; > else > $this->ps = 50; So - "ps" ist used. But where is "pg"? Maybe this is just a typo and it should be: if (!empty($_GET["pg"])) $this->ps = (int) $_GET["pg"]; else $this->ps = 50; > No pagination, but at least all the articles are showing. I doubt I'll > ever have any more than 50 articles in one category (and if I do I can > just increase it). Why does the script assume, that a missing "pg" parameter should be handled as "show page 50"? Why not just page 0 (or 1, if 1 is the first page)? -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de