<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Pagination in PHP</title>
	<atom:link href="http://1scripts.net/blog/2008/07/18/pagination-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/</link>
	<description>Blog of a PHP/HTML coder</description>
	<pubDate>Fri, 12 Mar 2010 03:23:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: PHP Expert</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-123</link>
		<dc:creator>PHP Expert</dc:creator>
		<pubDate>Sat, 23 May 2009 09:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-123</guid>
		<description>Works great !

Thanks !
____________________
Saguenay-IT, (IT Outsourcing, SOA, PHP, ASP, Flex, ActionScript, JavaScript...)</description>
		<content:encoded><![CDATA[<p>Works great !</p>
<p>Thanks !<br />
____________________<br />
Saguenay-IT, (IT Outsourcing, SOA, PHP, ASP, Flex, ActionScript, JavaScript&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Partack</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-116</link>
		<dc:creator>Partack</dc:creator>
		<pubDate>Mon, 13 Apr 2009 10:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-116</guid>
		<description>at first i thought this tutorial was useful but left very little for expansion. not to mention the method is a little wrong.. because you should sort it by pages not posts.. pages are the key to linking all of the posts and the range per page, together. 

 i later found a different method.  using the math of 

$totalpages = ceil($sqltotalposts['id'] / $limit);

and

$set_limit = $page * $limit - ($limit-1);

which made a lot more sense and worked a lot more fluidly.

sorry for the negative comment but i think this tutorial contains bad methods.</description>
		<content:encoded><![CDATA[<p>at first i thought this tutorial was useful but left very little for expansion. not to mention the method is a little wrong.. because you should sort it by pages not posts.. pages are the key to linking all of the posts and the range per page, together. </p>
<p> i later found a different method.  using the math of </p>
<p>$totalpages = ceil($sqltotalposts['id'] / $limit);</p>
<p>and</p>
<p>$set_limit = $page * $limit - ($limit-1);</p>
<p>which made a lot more sense and worked a lot more fluidly.</p>
<p>sorry for the negative comment but i think this tutorial contains bad methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpscriptcoder</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-103</link>
		<dc:creator>phpscriptcoder</dc:creator>
		<pubDate>Mon, 27 Oct 2008 20:55:25 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-103</guid>
		<description>This probably shows all the numbers (I haven't tested it though).

$numpages = ceil($numposts / $perpage);
for($i = 1; $i &lt; $numpages + 1; $i++)
{
if($i = 1)
  $start = 0;
else
  $start = $perpage * i;
echo '&lt;a href="guestbook.php?start='.$start.'" rel="nofollow"&gt;'.$i.'&lt;/a&gt; ';
}

I made another pagination code a few years ago that had numbers, but I have no idea what it is.</description>
		<content:encoded><![CDATA[<p>This probably shows all the numbers (I haven&#8217;t tested it though).</p>
<p>$numpages = ceil($numposts / $perpage);<br />
for($i = 1; $i &lt; $numpages + 1; $i++)<br />
{<br />
if($i = 1)<br />
  $start = 0;<br />
else<br />
  $start = $perpage * i;<br />
echo &#8216;&lt;a href=&quot;guestbook.php?start=&#8217;.$start.&#8217;&quot; rel=&quot;nofollow&quot;&gt;&#8217;.$i.&#8217;&lt;/a&gt; &#8216;;<br />
}</p>
<p>I made another pagination code a few years ago that had numbers, but I have no idea what it is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krisstaar</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-102</link>
		<dc:creator>Krisstaar</dc:creator>
		<pubDate>Mon, 27 Oct 2008 13:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-102</guid>
		<description>Thanks a bundle for the script. Works great with my guestbook!

I modified it so it reads a file (to where all the entries are written) into an array using "file()" (I haven't got mysqlDB) and it works like a charm!

You wouldn't happen to have a tip on how to number the pages instead of just giving the option of next and previous page? (e.g )

I thought mabye
if($start = 0)
{
	$text .= '1&#124;&lt;a href="guestbook.php?start='.($start + $perpage).'" rel="nofollow"&gt;2&lt;/a&gt;&#124;&lt;a href="guestbook.php?start='.($start + $perpage + $perpage).'" rel="nofollow"&gt;3&lt;/a&gt;';
}
elseif($start = $perpage)
{
	$text .= '&lt;a href="guestbook.php?start='.($start - $perpage).'" rel="nofollow"&gt;1&lt;/a&gt;&#124;2&#124;&lt;a href="guestbook.php?start='.($start - $perpage).'" rel="nofollow"&gt;3&lt;/a&gt;&#124;&lt;a href="guestbook.php?start='.($start + $perpage + $perpage).'" rel="nofollow"&gt;4&lt;/a&gt;';
}

elseif($start = $perpage + $perpage)
....etc.


But this seems a bit more laborous than it should...

Any bright thoughts?</description>
		<content:encoded><![CDATA[<p>Thanks a bundle for the script. Works great with my guestbook!</p>
<p>I modified it so it reads a file (to where all the entries are written) into an array using &quot;file()&quot; (I haven&#8217;t got mysqlDB) and it works like a charm!</p>
<p>You wouldn&#8217;t happen to have a tip on how to number the pages instead of just giving the option of next and previous page? (e.g )</p>
<p>I thought mabye<br />
if($start = 0)<br />
{<br />
	$text .= &#8216;1|&lt;a href=&quot;guestbook.php?start=&#8217;.($start + $perpage).&#8217;&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt;|&lt;a href=&quot;guestbook.php?start=&#8217;.($start + $perpage + $perpage).&#8217;&quot; rel=&quot;nofollow&quot;&gt;3&lt;/a&gt;&#8217;;<br />
}<br />
elseif($start = $perpage)<br />
{<br />
	$text .= &#8216;&lt;a href=&quot;guestbook.php?start=&#8217;.($start - $perpage).&#8217;&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;|2|&lt;a href=&quot;guestbook.php?start=&#8217;.($start - $perpage).&#8217;&quot; rel=&quot;nofollow&quot;&gt;3&lt;/a&gt;|&lt;a href=&quot;guestbook.php?start=&#8217;.($start + $perpage + $perpage).&#8217;&quot; rel=&quot;nofollow&quot;&gt;4&lt;/a&gt;&#8217;;<br />
}</p>
<p>elseif($start = $perpage + $perpage)<br />
&#8230;.etc.</p>
<p>But this seems a bit more laborous than it should&#8230;</p>
<p>Any bright thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpscriptcoder</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-89</link>
		<dc:creator>phpscriptcoder</dc:creator>
		<pubDate>Tue, 16 Sep 2008 23:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-89</guid>
		<description>Oops, sorry about that. I ripped this out of my CMS where $text is the variable containing the page content, and is printed later in the script.</description>
		<content:encoded><![CDATA[<p>Oops, sorry about that. I ripped this out of my CMS where $text is the variable containing the page content, and is printed later in the script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Them Cuiper</title>
		<link>http://1scripts.net/blog/2008/07/18/pagination-in-php/#comment-86</link>
		<dc:creator>Them Cuiper</dc:creator>
		<pubDate>Sat, 13 Sep 2008 18:41:37 +0000</pubDate>
		<guid isPermaLink="false">http://1scripts.net/blog/?p=24#comment-86</guid>
		<description>please add the following after the last if statement:

echo $text;</description>
		<content:encoded><![CDATA[<p>please add the following after the last if statement:</p>
<p>echo $text;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
