BahamasNassau ... thanks $capbits=@file_get_contents("https://www.countries-ofthe-world.com/capitals-of-the-world.html"); $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("", $huhbits[1]); if (sizeof($posthuhbits) > 1) { $preposthuhbits=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=[]; $htmlis="

Country Capital Quiz

Score: 0 Goes: 0



RJM Programming

November, 2016




Country?
"; $scriptis="Country Capital Quiz \n \n \n var sprefix='', choice=-1, score=0, goes=0, num=0, capitals=[], countries=[], countryids=[]; var uprefix=\"http://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=''; 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) { uprefix+=sprefix + '%20[~' + encodeURIComponent(osel.options[osel.selectedIndex].text) + '~,66]%20'; sprefix=','; iframeit(); } function andlater() { document.getElementById('myspost').click(); } function setup(ins) { uprefix+=sprefix + '%20[~' + encodeURIComponent(ins) + '~,66]%20'; sprefix=','; iframeit(); } function ourcomp(c1,c2) { 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 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=countryids[choice] + '-' + capitals[choice]; setup(countryids[choice].replace(/_/g,' ')); document.getElementById('icapital').value=''; setTimeout(fit, 1500); } function fit() { document.getElementById('icapital').focus(); } \n"; $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; $seloneis=str_replace("", "", $seloneis); $divis=str_replace("", $outcapital . "", $divis); $num++; } } echo str_replace("", $divis . "", str_replace("", "" . $scriptis . "", str_replace("