//PHP-handled (by apache) file that converst the URL-string into catid=catname, mainly cosmetic
//print ("
Sorry The CatDeals.com online catelog is offline for two weeks
//for scheduled upgrades. Please contact us directly if there is something
//we can help you with.
");
//exit;
$cat_path=substr($PHP_SELF,10);
$cat_path=urldecode($cat_path);
if(substr($cat_path,strlen($cat_path)-1) == "/")
$cat_path=substr($cat_path,0,strlen($cat_path)-1);
$cat_path=trim($cat_path);
//If we were given the category as it's id, great, keep it!
if(is_numeric($cat_path)){
$cat_id=$cat_path;
}
//Otherwise ask the database what that category's id is
else{
require("config.inc.php");
$query=mysql_query("select type_id from categories where type_name='$cat_path'") or die(write_mysqlerror());
if(mysql_num_rows($query) == 0){
print("Error 404 on $cat_path - Category not found.");
exit;
}
$row=mysql_fetch_row($query);
$cat_id=$row[0];
}
//Now print out the category.php as if we directly called category.php?cat_id=cat_id
include("category.php");