BahamasNassau ... thanks //$capbits=@file_get_contents("https://www.countries-ofthe-world.com/capitals-of-the-world.html"); $capbits=" CountryCapital city A AfghanistanKabul AlbaniaTirana AlgeriaAlgiers AndorraAndorra la Vella AngolaLuanda Antigua and BarbudaSaint John's ArgentinaBuenos Aires ArmeniaYerevan AustraliaCanberra AustriaVienna AzerbaijanBaku B BahamasNassau BahrainManama BangladeshDhaka BarbadosBridgetown BelarusMinsk BelgiumBrussels BelizeBelmopan BeninPorto-Novo BhutanThimphu BoliviaLa Paz (administrative), Sucre (judicial) Bosnia and HerzegovinaSarajevo BotswanaGaborone BrazilBrasilia BruneiBandar Seri Begawan BulgariaSofia Burkina FasoOuagadougou BurundiBujumbura C Cabo VerdePraia CambodiaPhnom Penh CameroonYaounde CanadaOttawa Central African RepublicBangui ChadN'Djamena ChileSantiago ChinaBeijing ColombiaBogotá ComorosMoroni Democratic Republic of the CongoKinshasa Republic of the CongoBrazzaville Costa RicaSan Jose Cote d'IvoireYamoussoukro CroatiaZagreb CubaHavana CyprusNicosia Czech RepublicPrague D DenmarkCopenhagen DjiboutiDjibouti (city) DominicaRoseau Dominican RepublicSanto Domingo E EcuadorQuito EgyptCairo El SalvadorSan Salvador Equatorial GuineaMalabo EritreaAsmara EstoniaTallinn EthiopiaAddis Ababa F FijiSuva FinlandHelsinki FranceParis G GabonLibreville GambiaBanjul GeorgiaTbilisi GermanyBerlin GhanaAccra GreeceAthens GrenadaSaint George's GuatemalaGuatemala City GuineaConakry Guinea-BissauBissau GuyanaGeorgetown H HaitiPort-au-Prince HondurasTegucigalpa HungaryBudapest I IcelandReykjavik IndiaNew Delhi IndonesiaJakarta IranTehran IraqBaghdad IrelandDublin IsraelJerusalem ItalyRome J JamaicaKingston JapanTokyo JordanAmman K KazakhstanAstana KenyaNairobi KiribatiSouth Tarawa KosovoPristina KuwaitKuwait City KyrgyzstanBishkek L LaosVientiane LatviaRiga LebanonBeirut LesothoMaseru LiberiaMonrovia LibyaTripoli LiechtensteinVaduz LithuaniaVilnius LuxembourgLuxembourg "; $thiscap=""; function countryid($cinis) { return str_replace('.', '_', str_replace(' ', '_', str_replace('"', '_', str_replace("'", "_", $cinis)))); } function mapcapital($cincountry) { global $capbits, $thiscap; $retcap=""; $thiscap=""; $ctrys=explode(" title='", $cincountry); if (sizeof($ctrys) > 1) { $ctryiss=explode("'", $ctrys[1]); $huhbits=explode(">" . $ctryiss[0], $capbits); if (sizeof($huhbits) == 1) $huhbits=explode("(" . $ctryiss[0], $capbits); if (sizeof($huhbits) > 1) { $posthuhbits=explode("", $posthuhbits[1]); $thiscap=str_replace('.', '_', str_replace(' ', '_', str_replace('"', '_', str_replace("'", "_", str_replace("'", "`", $preposthuhbits[0]))))); $retcap=str_replace("title='" . $ctryiss[0] . "", "title='" . str_replace("'", "`", $preposthuhbits[0]) . "", $cincountry); } } } return $retcap; } $num=0; $countries=[]; $capitals=[]; $countryids=[]; $idisplay=""; $ititle=""; if (isset($_GET['capital_country'])) { $idisplay="visibility:hidden;"; $ititle="Anagram of capital. You choose country at left."; } $htmlis="

Country Capital Quiz

Score: 0 Goes: 0



RJM Programming

November, 2016




CountryCapital city
M
MacedoniaSkopje
MadagascarAntananarivo
MalawiLilongwe
MalaysiaKuala Lumpur
MaldivesMale
MaliBamako
MaltaValletta
Marshall IslandsMajuro
MauritaniaNouakchott
MauritiusPort Louis
MexicoMexico City
MicronesiaPalikir
MoldovaChisinau
MonacoMonaco
MongoliaUlaanbaatar
MontenegroPodgorica
MoroccoRabat
MozambiqueMaputo
Myanmar (Burma)Naypyidaw
N
NamibiaWindhoek
NauruYaren District
NepalKathmandu
NetherlandsAmsterdam
New ZealandWellington
NicaraguaManagua
NigerNiamey
NigeriaAbuja
North KoreaPyongyang
NorwayOslo
O
OmanMuscat
P
PakistanIslamabad
PalauNgerulmud
PalestineRamallah
PanamaPanama City
Papua New GuineaPort Moresby
ParaguayAsunción
PeruLima
PhilippinesManila
PolandWarsaw
PortugalLisbon
Q
QatarDoha
R
RomaniaBucharest
RussiaMoscow
RwandaKigali
S
Saint Kitts and NevisBasseterre
Saint LuciaCastries
Saint Vincent and the GrenadinesKingstown
SamoaApia
San MarinoSan Marino
Sao Tome and PrincipeSão Tomé
Saudi ArabiaRiyadh
SenegalDakar
SerbiaBelgrade
SeychellesVictoria
Sierra LeoneFreetown
SingaporeSingapore
SlovakiaBratislava
SloveniaLjubljana
Solomon IslandsHoniara
SomaliaMogadishu
South AfricaPretoria (administrative), Cape Town (legislative), Bloemfontein (judicial)
South KoreaSeoul
South SudanJuba
SpainMadrid
Sri LankaSri Jayawardenepura Kotte
SudanKhartoum
SurinameParamaribo
SwazilandMbabane
SwedenStockholm
SwitzerlandBern
SyriaDamascus
T
TaiwanTaipei
TajikistanDushanbe
TanzaniaDodoma
ThailandBangkok
Timor-LesteDili
TogoLomé
TongaNukuʻalofa
Trinidad and TobagoPort of Spain
TunisiaTunis
TurkeyAnkara
TurkmenistanAshgabat
TuvaluFunafuti
U
UgandaKampala
UkraineKyiv
United Arab EmiratesAbu Dhabi
United KingdomLondon
United States of AmericaWashington, D.C.
UruguayMontevideo
UzbekistanTashkent
V
VanuatuPort Vila
Vatican City (Holy See)Vatican City
VenezuelaCaracas
VietnamHanoi
Y
YemenSana'a
Z
ZambiaLusaka
ZimbabweHarare
", $huhbits[1]); if (sizeof($posthuhbits) > 1) { $preposthuhbits=explode("
Country?
"; $scriptis="Country Capital Quiz \n \n \n var sprefix='', choice=-1, score=0, goes=0, num=0, capitals=[], countries=[], countryids=[]; var uprefix=\"//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Countries&onclick=y&width=298&height=194&country=Country&popularity=Intensity&guess=&data=\"; function iframeit() { document.getElementById('dgeochart').innerHTML=''; } function checkforpost(insg, oiframe, owhere) { var outs=insg, fbits='', anal=0, capis=''; if (oiframe == null) { fbits='
'; } else { if (oiframe.name != '') { fbits='
'; } else { fbits='
'; } } if (insg.length > 950) { var outarr=insg.split('#')[0].split('?'); if (outarr.length > 1) { var outarrtwo=outarr[1].split('&'), oath; for (var im=0; im',''); } } if (owhere == null) { owhere=document.getElementById('mydpost'); if (owhere == null) { if (document.getElementById('mydpost')) { document.getElementById('mydpost').innerHTML=fbits; setTimeout(andlater,1500); outs=\"#\"; } else { document.body.innerHTML+='
' + fbits + '
'; setTimeout(andlater,1500); outs=\"#\"; } } else { owhere.innerHTML=fbits; setTimeout(andlater,1500); outs=\"#\"; } } else { owhere.innerHTML=fbits; setTimeout(andlater,1500); outs=\"#\"; } } return outs; } function selchangeit(osel) { if (osel.id == 'countrytwo') { //alert(osel.value + ' vs ' + document.getElementById('country').value); check(osel); this.value=''; } else { uprefix+=sprefix + '%20[~' + encodeURIComponent(osel.options[osel.selectedIndex].text) + '~,66]%20'; sprefix=','; iframeit(); } } function andlater() { if (document.URL.indexOf('capital_country') == -1) { document.getElementById('myspost').click(); } } function setup(ins) { if (document.URL.indexOf('capital_country') == -1) { uprefix+=sprefix + '%20[~' + encodeURIComponent(ins) + '~,66]%20'; sprefix=','; iframeit(); } } function ourcomp(c1,c2) { if (c1 == c2) { return true; } var xc1=c1.replace(/_/g,' ').replace(/`/g,' '); var xc2=c2.split('-')[1].replace(/_/g,' ').replace(/`/g,' '); if (xc2.toLowerCase().indexOf(xc1.toLowerCase()) != -1 && xc1.toLowerCase().length > 3) { return true; } return false; } \n function why(owhy) { if (1 == 1) { return owhy; } else { return owhy.split('(')[0].split('-')[0].replace(/_/g,' ').replace(/-/g,' '); } } \n function precheck() { if (document.getElementById('countrylist')) { if (document.getElementById('country').value != '') { selchangeit(document.getElementById('country')); } } } \n function check(inv) { if (inv.value != '') { var suffix=''; goes++; if (ourcomp(inv.value,document.getElementById('country').value)) { score++; } else { suffix=' The country ' + document.getElementById(countryids[choice]).id.replace(/_/g,' ') + '
represented by
has the capital city ' + document.getElementById(countryids[choice]).title; } if (document.getElementById('ssuffix')) { document.getElementById('ssuffix').innerHTML=suffix; suffix=''; } document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix; choose(); } } \n function choose() { choice = Math.floor(Math.random() * num); document.getElementById('country').value=why(countryids[choice] + '-' + capitals[choice]); capis=capitals[choice]; setup(countryids[choice].replace(/_/g,' ')); document.getElementById('icapital').value=''; anal=0; if (\"" . $ititle . "\" != \"\") { document.getElementById('countrytwo').value=''; document.getElementById('icapital').placeholder=''; fit(); } setTimeout(fit, 1500); } function fit() { if (\"" . $ititle . "\" != \"\") { if (eval(-1 + anal) < capis.length) { document.getElementById('icapital').placeholder+=capis.substring(anal,eval(1 + anal)).replace('_',' '); anal++; setTimeout(fit,1500); } } else { document.getElementById('icapital').focus(); } } \n"; if ($isSafari){ $seloneis="
"; } else { $seloneis="
"; } if (isset($_GET['capital_country'])) { $seloneis=str_replace("", "", $seloneis); } $divis="
"; foreach (glob("../tikiwiki/img/flags/*.gif") as $filename) { $bits=explode("/", $filename); $postbits=explode(".", $bits[-1 + sizeof($bits)]); $idis=countryid($postbits[0]); $outcapital=mapcapital(""); if ($outcapital != "") { $countries[$num]=$postbits[0]; $scriptis=str_replace("", " countries.push(\"" . str_replace("_", " ", $postbits[0]) . "\"); countryids.push(\"" . $idis . "\"); capitals.push(\"" . $thiscap . "\"); num++; \n", $scriptis); $countryids[$num]=$idis; if ($isSafari){ $seloneis=str_replace("", "", $seloneis); } else { $seloneis=str_replace("", "", $seloneis); } $divis=str_replace("", $outcapital . "", $divis); $num++; } } echo str_replace("", $divis . "", str_replace("", "" . $scriptis . "", str_replace("