0
你好,我已經創造清潔網址 ,但我想要的東西,得到動態的URL並獲得動態查詢如何實現動態URL並獲得動態查詢
我要像鏈接 此 http://localhost:8081/olshop/products/param/[category]-[gender]
sample : http://localhost:8081/olshop/products/param/pants-m
with paging
http://localhost:8081/olshop/products/param/[category]-[gender]/paging
sample : http://localhost:8081/olshop/products/param/pants-m/1
但此用戶可以像這樣更換過濾器
http://localhost:8081/olshop/products/param/[category]
sample : http://localhost:8081/olshop/products/param/pants
with paging
http://localhost:8081/olshop/products/param/[category]/paging
sample : http://localhost:8081/olshop/products/param/pants/1
or
http://localhost:8081/olshop/products/param/[gender]
sample : http://localhost:8081/olshop/products/param/m
with paging
http://localhost:8081/olshop/products/param/[gender]/paging
sample : http://localhost:8081/olshop/products/param/m/1
or
http://localhost:8081/olshop/products/param/[gender]-[category]
sample : http://localhost:8081/olshop/products/param/m-pants
with paging
http://localhost:8081/olshop/products/param/[gender]-[category]/paging
sample : http://localhost:8081/olshop/products/param/m-pants/1
how to technique li這個?
我困惑,實施到我的代碼和的.htaccess
這是我目前的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule index$ index.php [L]
RewriteRule ^products/(\d+)$ index.php?p=products&page=$1 [L]
RewriteRule ^products/param/([^/]+)/?$ index.php?p=products¶m=$1 [L]
RewriteRule ^products/param/(.*)\/(\d+)$ index.php?p=products¶m=$1&page=$2 [L]
RewriteRule ^([^/.]+)/?$ index.php?p=$1 [QSA,L]
</IfModule>
,這是我的我的代碼
<?php
if($_GET['param']!=NULL)
{
$query = mysqli_query($con,"select * from goods where category='".$_GET['param']."' and gender='".$_GET['param']."' order by date_publish DESC LIMIT $start, $limit");
}
else
{
$query = mysqli_query($con,"select * from goods order by date_publish DESC LIMIT $start, $limit");
}
?>
幫助我感謝的
部分或者您有解決方案或其他?