Re: search result page, need some ideas on how to do [PREV] 1 2 3 4 [NEXT] stuff..
| From: | Chris Lee | Date: | Fri, 05 Oct 2001 16:14:26 +0000 |
| Subject: | Re: search result page, need some ideas on how to do [PREV] 1 2 3 4 [NEXT] stuff.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70107@lists.php.net to get a copy of this message | ||
there are tutorials posted all over the inet, and all over this news group.
take a look around.
Ive left out the details and stuck with the basics, modify as needed, you'll
need to :)
if (!isset($HOW_MANY))
$HOW_MANY = 10;
if (!isset($position))
$position = 0;
$prev = $position - $HOW_MANY;
$next = $position + $HOW_MANY;
$query = "SELECT * FROM table LIMIT $position, $HOW_MANY";
$search_a = $position;
$search_b = $next;
$search_c = @$product->product_count;
if ($search_b > $search_c)
$search_b = $search_c;
echo "
Displaying $search_a - $search_b of $search_c Orders
";
if ($prev >= 0)
echo "
<a href='$PHP_SELF?position=$prev'><$IMG
src='image/back.gif'></a>
";
echo "
<a href='$PHP_SELF?position=0'><$IMG
src='image/home.gif'></a>
";
if ( $next < $search_c )
echo "
<a href='$PHP_SELF?position=$next'><$IMG
src='image/next.gif'></a>
";
--
Chris Lee
lee@mediawaveonline.com
"Nicklas Bondesson" <nicklas.bondesson@eds.com> wrote in message
news:20011005133205.98101.qmail@pb1.pair.com...
> all ideas are very welcomed !!
>
> /nicke
>
>