What I am trying to do is go from:
product.php?PageID=$ProductCategory&ProductCategory=$ProductCategory
to
product.php/PageID/ProductCategory/ProductCategory/ProductCategory
which will make it more search engine friendly. I found the code below and cant seem to get it to work.
<?php
$url_array=explode("/",$PATH_INFO);
if (count($url_array)>1)
{
for ($i=1;$i<count($url_array);$i+=2)
{
$name=$url_array[$i];
$value=$url_array[$i+1];
$str='$'.$name.'="'.$value.'";';
eval($str);
}
}
?>
My original script that queries to links:
<?php
Function CategoryList($table_pro = 'Products') {
global $name;
global $value;
$query = "SELECT ProductCategory
FROM $table_pro
GROUP BY ProductCategory";
$result = @($query);
while(list($ProductCategory) =
mysql_fetch_row($result))
print(" -» <a href=\"products.php?PageID=$ProductCategory&ProductCategory=$ProductCategory\" class=\"categorylist\">$ProductCategory</a><br>\n");
}
CategoryList()
?>
How would I implement it or where can I find more info on this subject.
Thanks,
Brett