<?='<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'?>
<?	$dbh=mysql_pconnect("localhost","hrscom_shoes","sande2000");mysql_select_db("hrscom_shoes");
	$Asql ="SELECT Distinct prodBrand FROM zappos
	where prodCat like '%bags%' and
	(prodPrice > 0 or prodSale > 0) ORDER BY prodBrand";
	$cli_query = mysql_query($Asql) or die(mysql_error());
	$cli_num = mysql_num_rows($cli_query);
	$total_rows = ceil($cli_num/4); 
if($cli_num > 0) { //
	  $x=0;  	
      	while($cli = mysql_fetch_array($cli_query)) {
$x=$x+1;
$page=str_replace(" ","-",strtolower($cli["prodBrand"]));

echo '
 <url>
  <loc>http://global-bags.com/bags_',stripslashes($page),'.html</loc>
  <lastmod>',date("Y-m-d"),'</lastmod>
  <changefreq>daily</changefreq>
  <priority>1.0</priority>
 </url> ';
}

}?>
<?$Bsql="Select * FROM zappos WHERE
	prodCat like '%bags%' and
	(prodPrice > 0 or prodSale > 0) ORDER BY prodName";
	$b_query = mysql_query($Bsql) or die(mysql_error());
	$b_num = mysql_num_rows($b_query);
	$b_total = ceil($b_num/4);
	if($b_num > 0) { //
	$x=0;
	while($row = mysql_fetch_array ($b_query)){
$string = trim($row["prodName"]);
$patterns = array('/\) - /','/ \(/','/ - /','/\//','/\./','/ /','/&quot;/','/&amp;/','/\+/');
$replacements = array('---','-in-','--','-and-','-point-','_','-quote-','-n-','-plus-');
$string=preg_replace($patterns, $replacements, $string);
$x=$x+1; 
echo '
 <url>
  <loc>http://global-bags.com/bag-',stripslashes($string),'.html</loc>
  <changefreq>weekly</changefreq>
  <priority>0.5</priority>
 </url> ';
}
print('
</urlset> ');
}?>