\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); } $sql = "SELECT DISTINCT Name, County, votes, CountyName, clientpic FROM Towns INNER JOIN townvotes ON townvotes.townid = Towns.ID INNER JOIN CountyDetails ON CountyDetails.RecordID = Towns.County ORDER BY votes DESC"; if(!isset($_GET['listall'])){$sql .= " LIMIT 100";} $q = mysql_query($sql)or mailjim("q", mysql_error()); $top = mysql_fetch_object($q); mysql_data_seek($q, 0); $qtown = !empty($top->Name) ? mysql_real_escape_string(ucwords($top->Name)) : 'Worcester'; $townpix = mysql_query("SELECT townpix.*, EstDetails.Name FROM townpix LEFT JOIN EstDetails ON EstDetails.RecordID = townpix.clientid WHERE townpix.town LIKE '$qtown' AND townpix.county = $top->County")or mailjim("townpix", mysql_error()); if(!empty($top->clientpic)){ $sql = "SELECT Name FROM EstDetails WHERE RecordID = $top->clientpic LIMIT 1"; $Ename = mysql_query($sql)or mailjim("Ename", "$sql\n".mysql_error()); $pname = mysql_fetch_object($Ename); } $tot = mysql_query("SELECT SUM(votes) AS total FROM townvotes")or mailjim("q", mysql_error()); $total = mysql_fetch_object($tot); $pageurl = $_SERVER['REQUEST_URI']; $cpcount = mysql_query("UPDATE pagecounter SET pagecount=pagecount+1 WHERE pageurl = '$pageurl'"); if(mysql_affected_rows()==0){$cpcount = mysql_query("INSERT INTO pagecounter(pageurl, pagecount, firstday) VALUES ('$pageurl', 1, NOW())");} $cq = mysql_query("SELECT pagecount FROM pagecounter WHERE pageurl = '$pageurl' "); $gcq = mysql_fetch_object($cq); $vcount = $gcq->pagecount; echo <<Britain's favourite Town is $top->Name, $top->CountyName EOT; ?>
Britain's Favourite town, $total->total votes\n"; include'linkunit.txt'; $townurl = str_replace(' ', '-', ucwords($top->Name)); $trow = mysql_fetch_object($townpix); /*if(!function_exists('file_exists')){ function file_exists($path){ return (@fopen($path,"r")==true); } }*/ if(file_exists("images/townpics/$townurl$top->County.jpg")){ echo"
$town
"; if($trow->caption){echo"$trow->caption";} } elseif(mysql_num_rows($townpix) > 0){ echo""; } elseif($top->clientpic > 0){ echo""; } ?>

What makes a town or city a good - or great - place to live? It's not just a matter of architecture; or a successful football team or economy; or even great pubs and clubs. And in the UK it is surely not to do with the weather. There is something intangible - like trying to define the idea of home - about the best of Britain. With so many of us nowadays moving around the country - born here, studied, worked and stayed there - our knowledge is far wider than it used to be. So when you vote for your top town it could be where you come from, or where you'd like to go to. The choice is yours.


Current top towns
Name)); echo"

\n$count: $town->Name ($town->votes vote"; if($town->votes > 1){echo's';} echo") Name\">

\n"; $count ++; } ?> Show all town votes

Page viewed $vcount times since 2nd June 2010

"; include'dailyfeature.php'; ?>