View Single Post
Old 12-09-2007, 02:27 PM   #19 (permalink)
Matt83
The Contributor
Upcoming Programmer 
 
Matt83's Avatar
 
Join Date: Oct 2007
Location: Argentina
Posts: 72
Thanks: 18
Matt83 is on a distinguished road
Default

Quote:
Originally Posted by crazyryan View Post
Thanks for the advice, I have one more problem.

My site uses mod_rewrite on the category pages and I want to apply pagination, will that be a problem? My .htaccess code is RewriteRule "^category/([0-9]+).html$" category.php?id=$1 [Last]

And my PHP code is
PHP Code:
<?php
            
            $query 
mysql_query("select * from games where catid = '$id' limit 0,10");
            while(
$row mysql_fetch_array($query)) {
            
$url '/game/' strtolower(str_replace('--''-'str_replace(' ''-'preg_replace('/[^\sA-Za-z0-9]+/'''$row['title'])))) . '-' $row['id'] . '.html';
                echo 
'<p style="margin-bottom: 10px;"><img src="' $row['thumbnail'] . '" style="float: left; margin-right: 10px;" />
            <strong><a href="' 
$url '">' $row['title'] . '</a></strong> - <small>Played ' $row['plays'] . ' times!</small><br />
            ' 
$row['description'] . '</p>';
            }
            
?>
I'm not sure if this will conflict if I use pagination and what not?

Any help?

You could try this:

RewriteRule ^category/([0-9]+)/page\-([0-9]+)\.html$ category.php?id=$1&page=$2 [L,QSA]

and have the following URLs:

/category/1/page-1.html

Of course you will need to work on the query to make the pagination work. Talk a look at this tutorial or this one (more advanced).
__________________
http://www.mattvarone.com
Matt83 is offline  
Reply With Quote