<?php // GET HTML // $raw_in = file_get_contents("html/location_cn.html"); $cat2name = trim(urldecode(makeSpace($requestType[3]))); $cat1name = trim(urldecode(makeSpace($requestType[2]))); // SQL STATEMENTS // $category1 = mysql_query("SELECT * FROM locations WHERE md5(id) = '" . $requestType[5] . "'"); $result = mysql_fetch_assoc($category1); // GET PAGE DATA // $sitename_cn = "搜索宁波"; $siteURL = "soningbo.com"; $location_id = $result['id']; $category1_cn = getCategoryChineseName($cat1name, 'cn'); $category2_cn = getCategory2ChineseName($cat2name, 'cn'); $all_category1 = getCategory1ListingCn(); $name_cn = $result['name_cn']; $address_cn = $result['address_cn']; $telephone = $result['telephone']; $topMenusItems = topMenusItems($lang, $request2, $staticPages); // COMBINE PAGE DATA AND HTML // $find = array("#sitename_cn", "#siteURL", "#category1_cn", "#category2_cn", "#name_cn", "#address_cn", "#telephone", "<li>#all_category1_cn</li>", "#location_id", "topMenusItems"); $replaceCatName = array($sitename_cn, $siteURL, $category1_cn, $category2_cn, $name_cn, $address_cn, $telephone, $all_category1, $location_id, $topMenusItems); $result = str_replace($find, $replaceCatName, $raw_in); // WRITE OUT HTML echo $result;
<?php if (!isset($_COOKIE['userid']) || empty($_COOKIE['userid'])) { header("location:" . LIVESITEURL); exit; } // GET HTML // $raw_in = file_get_contents("html/welcome.html"); // GET PAGE DATA // $sitename_cn = "搜索宁波"; $siteURL = "soningbo.com"; $category1Listing = getCategory1ListingCn(); $topMenusItems = topMenusItems($lang, $request2, $staticPages); // COMBINE PAGE DATA AND HTML // $find = array("#username", "#all_category1_cn", "#topMenusItems"); $replaceCatName = array($_COOKIE['username'], $category1Listing, $topMenusItems); $result = str_replace($find, $replaceCatName, $raw_in); // WRITE OUT HTML echo $result;
<?php if (!isset($_COOKIE['userid']) || empty($_COOKIE['userid'])) { header("location:" . LIVESITEURL); exit; } // GET HTML // $raw_in = file_get_contents("html/categories_cn.html"); // GET PAGE DATA // $sitename_cn = "搜索宁波"; $siteURL = "soningbo.com"; $category1Listing = getCategory1ListingCn(); $show_left_menu_cn = showLeftMenusCn($requestType); $catgory1_cn = getCategory1ListingCn($locations_info['category1_id']); $catgory2_cn = getCategory2ListingCn($locations_info['category2_id'], $locations_info['category1_id']); $selectedcat1_id = "cat1_" . $locations_info['category1_id']; $selectedcat2_id = "cat2_" . $locations_info['category2_id']; $topMenusItems = topMenusItems($lang, $request2, $staticPages); // COMBINE PAGE DATA AND HTML // $find = array("#sitename_cn", "#siteURL", "#show_left_menu_cn", "#username", "#all_category1_cn", "#catgory1_cn", "#category1_id", "#category2_id", "#catgory2_cn", "#selectedcat1_id", "#selectedcat2_id", "#location_id", "#topMenusItems"); $replaceCatName = array($sitename_cn, $siteURL, $show_left_menu_cn, $_COOKIE['username'], $category1Listing, $catgory1_cn, $locations_info['category1_id'], $locations_info['category2_id'], $catgory2_cn, $selectedcat1_id, $selectedcat2_id, $locations_info['location_id'], $topMenusItems); $result = str_replace($find, $replaceCatName, $raw_in); // WRITE OUT HTML echo $result;