rostros Posted August 30, 2009 Share Posted August 30, 2009 Hi Guys , having a little trouble getting this code through W3 XHTML Validation , Im using a Dreamweaver Pagination extension which I know using extensions is bad but this is a big project. Im familar with the concept of using & rather than & but it appears it still does't work. Anyway here is the code. - PHP Code / Variable $queryString_tbl_dealer_vehicles = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_tbl_dealer_vehicles") == false && stristr($param, "totalRows_tbl_dealer_vehicles") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_tbl_dealer_vehicles = "&" . htmlentities(implode("&", $newParams)); } } $queryString_tbl_dealer_vehicles = sprintf("&totalRows_tbl_dealer_vehicles=%d%s", $totalRows_tbl_dealer_vehicles, $queryString_tbl_dealer_vehicles); XHTML Page Code <?php for ($i=0; $i <= $totalPages_tbl_dealer_vehicles; $i++) { $TFM_PagesEndCount = $i + 1; if($i != $pageNum_tbl_dealer_vehicles) { printf('<a href="'."%s?pageNum_tbl_dealer_vehicles=%d%s", $currentPage, $i, $queryString_tbl_dealer_vehicles.'">'.$TFM_PagesEndCount."</a>"); }else{ echo(" [<strong>$TFM_PagesEndCount</strong>] "); } if($i != $totalPages_tbl_dealer_vehicles) echo(""); } ?> XHTML Error cannot generate system identifier for general entity "totalRows_tbl_dealer_vehicles" …x.php?pageNum_tbl_dealer_vehicles=1&totalRows_tbl_dealer_vehicles=8">2</a> -- It looks like the %s is the part where I need the & but this just gives more errors ? I hope someone can help me as I dont really want to code this site as non xhtml compliant. Thanks Quote Link to comment Share on other sites More sharing options...
rostros Posted August 30, 2009 Author Share Posted August 30, 2009 Okay quick fix managed to validate the code , if anybody is using Dreamweaver and you get the same problem just replace $queryString_tbl_dealer_vehicles = sprintf("&totalRows_tbl_dealer_vehicles=%d%s", $totalRows_tbl_dealer_vehicles, $queryString_tbl_dealer_vehicles); With Remove the &totalRows and replace it with "&" . totalRows_ $queryString_tbl_dealer_vehicles = sprintf("&" . "totalRows_tbl_dealer_vehicles=%d%s", $totalRows_tbl_dealer_vehicles, $queryString_tbl_dealer_vehicles); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.