Flags of the world as a css sprite.
The flag icons are from Mark James’s FamFamFam collection while the code is a slightly simplified and condensed version of the csscountrycodes project on Google Code. Released under a GNU General Public License v2.
Includes 247 icons in total. The sprite image is over 51% smaller in filesize than the individual icons and can be downloaded in just one HTTP request rather than over 200 so is recommended if you plan on displaying more than several different flag icons throughout your site.
flags_sprite.png 68Kb
flags.css 10Kb
flags.orig.css 12Kb
Flags can then be displayed using the following HTML:
<div class="flag gb" title="United Kingdom"> </div>
Additional flags include england, wales, scotland, the europeanunion and catalonia, e.g.:
<div class="flag wales" title="Wales"> </div>
Note: includes the 1.01 update which fixes line-height issues in IE6.
<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'peter', 'abc123');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ajax_demo", $con);
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysql_query($sql);
echo "";
var xmlhttp;
function showUser(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="getuser.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
/*This is a comment*/
p
{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial
}
LOAD DATA LOCAL INFILE '/Users/Dave/Downloads/codes.csv' INTO TABLE codes FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
Change engine:
ALTER TABLE tbl_name ENGINE=InnoDB;
Change charset:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;