{"id":54940,"date":"2022-02-19T03:01:34","date_gmt":"2022-02-18T17:01:34","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54940"},"modified":"2022-02-19T07:37:28","modified_gmt":"2022-02-18T21:37:28","slug":"english-word-guessing-game-intranet-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-intranet-tutorial\/","title":{"rendered":"English Word Guessing Game Intranet Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Intranet Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_nuance.jpg\" title=\"English Word Guessing Game Intranet Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Intranet Tutorial<\/p><\/div>\n<p>You might recall that in yesterday&#8217;s <a title='English Word Guessing Game MAMP Tutorial' href='#ewggmampt'>English Word Guessing Game MAMP Tutorial<\/a>  we had the temerity to use the word&#8230;<\/p>\n<blockquote><p>\nnuance\n<\/p><\/blockquote>\n<p> &#8230; or &#8220;not to look so dumb&#8221; regarding wise local web server (let&#8217;s say Intranet, today) macOS say interfacing.  In order to &#8220;not to look so dumb&#8221; we need to categorically tell the user whether a &#8230;<\/p>\n<p><code>HTTP:\/\/localhost:8888\/what_is_the_english_word.php<\/code><\/p>\n<p> &#8230; exists or not.  This is not straightforward, believe it or not.  In the old days, easy, but not with the cross-domain checking that goes on with your modern web browsers.  Today, though we think we&#8217;ve got an idea here, at least for a popup window of a local web server PHP file.<\/p>\n<ol>\n<li>we&#8217;ll call the popup a special way in a document.body onload event (Javascript function) &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n var ywoisme=null;<br \/>\n var wast='HTTP:\/\/localhost:8888\/what_is_the_english_word.php (MAMP)';<br \/>\n var hlbit='HTTP:\/\/localhost:8888\/what_is_the_english_word.php';<br \/>\n<br \/>\n function lhostlook() {<br \/>\n   if (hlbit != 'HTTP:\/\/localhost:8888\/what_is_the_english_word.php' && hlbit != 'HTTP:\/\/localhost:8888\/what_is_the_english_word.php (MAMP)') {     document.getElementById('asay').title=document.getElementById('asay').title.replace('HTTP:\/\/localhost:8888\/what_is_the_english_word.php (MAMP)', hlbit).replace('HTTP:\/\/localhost:8888\/what_is_the_english_word.php', hlbit);<br \/>\n   }<br \/>\n<br \/>\n   if (document.URL.indexOf('localhost') == -1) {<br \/>\n     var midbit='' + '\" . $midbit . \"';<br \/>\n     ywoisme=window.open(hlbit + '?imagetest=imagetest' + midbit + '.jpg','_blank','top=250,left=50,width=50,height=50');<br \/>\n     setTimeout(yw, 2000); \/\/ywoisme.close();<br \/>\n   }<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<li>getting (the same sourcecode) to do this self-contained PHP code snippet &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$midbit=rand(0,19876754);<br \/>\n$gretv='';<br \/>\n<br \/>\nfunction oururldecode($inue) {<br \/>\n  global $gretv;<br \/>\n  $retv=urldecode($inue);<br \/>\n  $retsare=explode(\"localhost\", $inue);<br \/>\n  if (sizeof($retsare) &gt; 1) {<br \/>\n    $retv=str_replace($retsare[0] . 'localhost' . explode('#', explode('?', explode('\/', $retsare[1])[0])[0])[0] . '\/', $_SERVER['DOCUMENT_ROOT'], $retv);<br \/>\n  }<br \/>\n  $gretv=$retv;<br \/>\n  return $retv;<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['imagetest']) && strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) {<br \/>\n  $im = imagecreatetruecolor(120, 10);<br \/>\n  $text_color = imagecolorallocate($im, 233, 14, 91);<br \/>\n  imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);<br \/>\n  \/\/ Output the image<br \/>\n  if (strpos(oururldecode($_GET['imagetest']), '.') === false) {<br \/>\n  if (file_exists(dirname(__FILE__) . \"\/\" . \"imagetest.jpg\")) { unlink(dirname(__FILE__) . \"\/\" . \"imagetest.jpg\");  }<br \/>\n  $gretv=dirname(__FILE__) . \"\/\" . \"imagetest.jpg\";<br \/>\n  imagejpeg($im, dirname(__FILE__) . \"\/\" . \"imagetest.jpg\");<br \/>\n  } else if (strpos(strtolower(oururldecode($_GET['imagetest'])), '.gif') !== false) {<br \/>\n  if (file_exists(oururldecode($_GET['imagetest']))) { unlink(oururldecode($_GET['imagetest']));  }<br \/>\n  imagegif($im, oururldecode($_GET['imagetest']));<br \/>\n  } else if (strpos(strtolower(oururldecode($_GET['imagetest'])), '.bmp') !== false) {<br \/>\n  if (file_exists(oururldecode($_GET['imagetest']))) { unlink(oururldecode($_GET['imagetest']));  }<br \/>\n  imagebmp($im, oururldecode($_GET['imagetest']), true);<br \/>\n  } else if (strpos(strtolower(oururldecode($_GET['imagetest'])), '.png') !== false) {<br \/>\n  if (file_exists(oururldecode($_GET['imagetest']))) { unlink(oururldecode($_GET['imagetest']));  }<br \/>\n  imagepng($im, oururldecode($_GET['imagetest']));<br \/>\n  } else if (strpos(strtolower(oururldecode($_GET['imagetest'])), '.jp') !== false) {<br \/>\n  if (file_exists(oururldecode($_GET['imagetest']))) { unlink(oururldecode($_GET['imagetest']));  }<br \/>\n  imagejpeg($im, oururldecode($_GET['imagetest']));<br \/>\n  }<br \/>\n  \/\/ Free up memory<br \/>\n  imagedestroy($im);<br \/>\n  if (file_exists($gretv)) {<br \/>\n  unlink($gretv);<br \/>\n  echo \"&lt;html&gt;&lt;body onload=\\\"window.close();\\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  }<br \/>\n  \/\/sleep(25);<br \/>\n  \/\/unlink(oururldecode($_GET['imgtest']));<br \/>\n  exit;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; us originally thinking the image existence could be checked but still running into lack of CORS issues got us, instead, &#8220;close thyself&#8221; on success\n<\/li>\n<li>and back in the caller&#8217;s Javascript client realm we now check on the closure status of that popup &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n function yw() {<br \/>\n   if (ywoisme.closed) {<br \/>\n     console.log('found');<br \/>\n     document.getElementById('asay').title=document.getElementById('asay').title.replace('Will be trying ', 'Will be trying the found ');<br \/>\n   } else {<br \/>\n     document.getElementById('asay').title=document.getElementById('asay').title.replace('Will be trying ', 'Will be trying, but did not find, ');<br \/>\n     console.log('not found');<br \/>\n     ywoisme.close();<br \/>\n   }<br \/>\n   ywoisme=null;<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; to definitively say whether the &#8220;say conduit via macOS local web server PHP means&#8221; exists\n<\/li>\n<\/ol>\n<p>And what about not being stringent about &#8230;<\/p>\n<p><code>HTTP:\/\/localhost:8888\/what_is_the_english_word.php<\/code><\/p>\n<p> &#8230; being that &#8220;say conduit via macOS local web server PHP means&#8221; URL basis?  We use Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window teaming with window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> methodologies &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n var wast='HTTP:\/\/localhost:8888\/what_is_the_english_word.php (MAMP)';<br \/>\n var hlbit='HTTP:\/\/localhost:8888\/what_is_the_english_word.php';<br \/>\n<br \/> <br \/>\n if (('' + localStorage.getItem('what_is_the_english_word')).replace(\/^null$\/g,'') != '') {<br \/>\n   hlbit=localStorage.getItem('what_is_the_english_word');<br \/>\n }<br \/>\n<br \/> <br \/>\n function relocalize() {<br \/>\n   var onewast=wast.split(' ')[0];<br \/>\n   if (document.getElementById('asay').title.indexOf('did not find, ') != -1) {<br \/>\n     onewast=document.getElementById('asay').split('did not find, ')[1].split(' ')[0];<br \/>\n   }<br \/>\n   var pwast=prompt('Tell me where what_is_the_english_word.php is located in a macOS local web server with access to say command line commnd.', onewast);<br \/>\n   if (pwast == null) { pwast=''; }<br \/>\n   if (pwast != '' && pwast != onewast && pwast.indexOf('localhost') &gt;= 7) {<br \/>\n     if (pwast.toLowerCase().indexOf('.php') == -1) { if (pwast.slice(-1) == '\/') { pwast+='what_is_the_english_word.php';  } else { pwast+='\/what_is_the_english_word.php';  }  }<br \/>\n      if (('' + localStorage.getItem('what_is_the_english_word')).replace(\/^null$\/g,'') != '') {<br \/>\n       localStorage.removeItem('what_is_the_english_word');<br \/>\n       localStorage.setItem('what_is_the_english_word', pwast);<br \/>\n      }<br \/>\n      location.href=document.URL;<br \/>\n   }<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-----GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-----GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-intranet-tutorial\/'>English Word Guessing Game Intranet Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggmampt'>Previous relevant <a target=_blank title='English Word Guessing Game MAMP Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-mamp-tutorial\/'>English Word Guessing Game MAMP Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game MAMP Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_say.jpg\" title=\"English Word Guessing Game MAMP Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game MAMP Tutorial<\/p><\/div>\n<p>Onto yesterday&#8217;s <a title='English Word Guessing Game Dropdown Tutorial' href='#ewggdt'>English Word Guessing Game Dropdown Tutorial<\/a> with today&#8217;s &#8220;MAMP&#8221; idea, what&#8217;s <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'><i>MAMP<\/i><\/a>?  It&#8217;s our favourite PHP supporting Apache\/PHP\/MySql local web server, which we use as a testing environment ahead of deploying web applications such as <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php----GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php----GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a> up at the RJM Programming public domain.<\/p>\n<p>And though we have used the great MAMP product with Windows, we normally use it in conjunction with a macOS underlying operating system, which has a marvellous <a target=_blank title='say command information from Apple' href='https:\/\/ss64.com\/osx\/say.html'><i>say<\/i><\/a> command used by PHP via <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> to turn words into audio output.  Cute, huh?!<\/p>\n<p>In our <i>first draft of using<\/i> we&#8217;re going to offer an emoji &#128266; link to try to use a &#8230;<\/p>\n<p><code>HTTP:\/\/localhost:8888\/what_is_the_english_word.php<\/code><\/p>\n<p> &#8230; macOS MAMP Document Root download of the code above (minus any &#8220;GETME&#8221; stuff), in a pre-emptive style of arrangement, which we might add a bit of nuance to into the future.<\/p>\n<p>We found we might want to recall this MAMP PHP in a window.open popup window via a form onsubmit event just before the form submission.  How can we hang around and do both?  We could do some ugly setTimeout arrangement perhaps, but we found with the immediate close of the popup window , the exec &#8220;say&#8221; command still had time to be triggered (we guess that being before the onload event), even with that immediate popup window close on the next Javascript statement.  Curiouser and curiouser!<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n function maybeaudio(isclick) {   \/\/ onsubmit call has isclick=1<br \/>\n   if (!isclick) {<br \/>\n     adoaudio='&doaudio=\" . $_GET['doaudio'] . \"';<br \/>\n   }<br \/>\n   if (!isclick && document.getElementById('speaker').innerHTML != '' && !document.getElementById('audio') && document.getElementById('prespeaker')) {   \/\/alert(156);<br \/>\n     document.getElementById('prespeaker').innerHTML='<input id=audio name=audio type=hidden value=\\\"\" . $stufftosay . \"\\\"><\/input>';<br \/>\n   }<br \/>\n   if ((window.self !== window.top && document.URL.indexOf('doaudio=') != -1) || (document.getElementById('speaker').innerHTML != '' && document.getElementById('audio'))) {<br \/>\n     if (document.getElementById('audio')) {<br \/>\n     document.getElementById('audio').value=\\\"\" . $stufftosay . \"\\\";<br \/>\n     }<br \/>\n     if (document.URL.indexOf(':8888\/') == -1 || !isclick) {<br \/>\n     if (donelist.indexOf(\\\"\" . str_replace('Player 1, ','',str_replace('Player ' . $_GET['doaudio'] . ', ','',str_replace('Player,','',$stufftosay))) . \"\\\") == -1) {<br \/>\n     var predl='Player ' + (('' + location.hash).replace('#','') + '1').substring(0,1) + ', ' + \\\"\" . str_replace('Player ' . $_GET['doaudio'] . ', ','',str_replace('Player,','',$stufftosay)) . \"\\\";<br \/>\n     if ((predl.indexOf('Player,') == -1 || window.self === window.top) && predl.indexOf('Player \" . $_GET['doaudio'] . \"') != -1) {<br \/>\n     donelist+='Player ' + (('' + location.hash).replace('#','') + '1').substring(0,1) + ', ' + \\\"\" . str_replace('Player ' . $_GET['doaudio'] . ', ','',str_replace('Player,','',$stufftosay)) . \"\\\";<br \/>\n     var zwoisme=window.open('HTTP:\/\/localhost:8888\/what_is_the_english_word.php?doaudio=' + (('' + location.hash).replace('#','') + '1').substring(0,1) + '&audio=' + encodeURIComponent('Player ' + (('' + location.hash).replace('#','') + '1').substring(0,1) + ', ' + \\\"\" . str_replace('Player ' . $_GET['doaudio'] . ', ','',str_replace('Player,','',$stufftosay)) . \"\\\"),'_blank','top=250,left=50,width=50,height=50');<br \/>\n     zwoisme.close();<br \/>\n     }<br \/>\n     }<br \/>\n     }<br \/>\n   }<br \/>\n   return true;<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-mamp-tutorial\/'>English Word Guessing Game MAMP Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggdt'>Previous relevant <a target=_blank title='English Word Guessing Game Dropdown Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-dropdown-tutorial\/'>English Word Guessing Game Dropdown Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Dropdown Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_dropdown.jpg\" title=\"English Word Guessing Game Dropdown Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Dropdown Tutorial<\/p><\/div>\n<p>Continuing the refinement of yesterday&#8217;s <a title='English Word Guessing Game Player Equality Tutorial' href='#ewggpet'>English Word Guessing Game Player Equality Tutorial<\/a>&#8216;s multi-player &#8220;English Word Guessing Game&#8221; usage aspects, there was a disappointment in that the &#8220;Equality&#8221; was broken down a little for users whose questions started &#8220;below the fold&#8221; of the (albeit scrollable) webpage table&#8217;s screen, and today, we lessen that unfairness, a tad, by offering new &#8220;within left table cell&#8221; dropdowns (or <a target=_blank href='http:\/\/www.w3schools.com\/tags\/tag_select.asp' title='HTML select tag information from w3schools'>select<\/a> elements) showing all user questions and clues at any given point of time, the work of which highlighted, to us &#8230;<\/p>\n<ul>\n<li><a target=_blank title='HTML DOM innerText property info from W3schools'  href='https:\/\/www.w3schools.com\/jsref\/prop_node_innertext.asp'>innerText<\/a> (<font color=blue>and its friends<\/font> &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\nvar ablurb=((<font color=blue>ahoneis[0].innerText || honeis[0].contentWindow || honeis[0].contentDocument<\/font>)).split('?')[0] + '?';<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n) <font size=1>property<\/font> &#8220;cutting through complexity&#8221; summary of textual element content (eg. our h1 header element made up of several smaller component elements, but its essential wording used in code below to construct the dropdown content, easily)<\/li>\n<li>dropdown element talents at saving space &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$seloh=\"&nbsp;&lt;select onclick=\\\" event.stopPropagation(); \\\" onchange=\\\" if (this.value.length != 0) { top.setgl('-' + this.value);   this.value='';  } \\\" id=isel style=display:none;width:15px;&gt;&lt;option value=''&gt; &lt;\/option&gt;&lt;\/select&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; yet allowing access to data (and not affect innerText), and its innerHTML attribute &#8220;populating&#8221; talents &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n function setopt(jnv, inv) {<br \/>\n   var ik=1;<br \/>\n   while (document.getElementById('isel' + ik)) {<br \/>\n     if (document.getElementById('isel' + ik).innerHTML.indexOf(' value=\\\"' + jnv + '\\\"&gt;') != -1) {<br \/>\n       document.getElementById('isel' + ik).innerHTML=document.getElementById('isel' + ik).innerHTML.replace(document.getElementById('isel' + ik).innerHTML.split(' value=\\\"' + jnv + '\\\"')[1].split('&lt;\/option&gt;')[0] + '&lt;', '&gt;' + inv + '&lt;');<br \/>\n     } else if (eval('' + jnv) == 1) {<br \/>\n       document.getElementById('isel' + ik).innerHTML=document.getElementById('isel' + ik).innerHTML.replace('&lt;\/option&gt;', '&lt;\/option&gt;' + '&lt;option value=\\\"' + jnv + '\\\"&gt;' + inv + '&lt;\/option&gt;');<br \/>\n     } else if (document.getElementById('isel' + ik).innerHTML.indexOf(' value=\\\"' + eval(1 + eval('' + jnv)) + '\\\"&gt;') != -1) {<br \/>\n       document.getElementById('isel' + ik).innerHTML=document.getElementById('isel' + ik).innerHTML.replace('&lt;option value=\\\"' + eval(1 + eval('' + jnv)) + '\\\"&gt;', '&lt;option value=\\\"' + jnv + '\\\"&gt;' + inv + '&lt;\/option&gt;' + '&lt;option value=\\\"' + eval(1 + eval('' + jnv)) + '\\\"&gt;');<br \/>\n     } else if (document.getElementById('isel' + ik).innerHTML.indexOf(' value=\\\"' + eval(-1 + eval('' + jnv)) + '\\\"&gt;') != -1) {<br \/>\n       document.getElementById('isel' + ik).innerHTML=document.getElementById('isel' + ik).innerHTML.replace(document.getElementById('isel' + ik).innerHTML.split(' value=\\\"' + eval(-1 + eval('' + jnv)) + '\\\"&gt;')[1].split('&lt;\/option&gt;')[0] + '&lt;\/option&gt;', document.getElementById('isel' + ik).innerHTML.split(' value=\\\"' + eval(-1 + eval('' + jnv)) + '\\\"&gt;')[1].split('&lt;\/option&gt;')[0] + '&lt;\/option&gt;' + '&lt;option value=\\\"' + jnv + '\\\"&gt;' + inv + '&lt;\/option&gt;');<br \/>\n     } else {<br \/>\n       document.getElementById('isel' + ik).innerHTML+='&lt;option value=\\\"' + jnv + '\\\"&gt;' + inv + '&lt;\/option&gt;';<br \/>\n     }<br \/>\n     ik++;<br \/>\n   }<br \/>\n }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<li>input type=text textbox onclick usefulness on mobile to also cater for user intent (to focus on a textbox)<\/li>\n<li>mobile <font size=1>(perhaps just iOS)<\/font> onfocus stubbornness &#8230; these days, more and more, a real user click is necessary<\/li>\n<li>event.stopPropagation() &#8220;hosted (dropdown) element&#8221; event logic to cancel the (onclick) event reaching its &#8220;parent (td) element&#8221;<\/li>\n<\/ul>\n<p> &#8230; talents for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php---GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php---GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-dropdown-tutorial\/'>English Word Guessing Game Dropdown Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggpet'>Previous relevant <a target=_blank title='English Word Guessing Game Player Equality Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-player-equality-tutorial\/'>English Word Guessing Game Player Equality Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Player Equality Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_players.jpg\" title=\"English Word Guessing Game Player Equality Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Player Equality Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='English Word Guessing Game Players Tutorial' href='#ewggpt'>English Word Guessing Game Players Tutorial<\/a> started multi-player scenarios with our &#8220;English Word Guessing Game&#8221; web application, but was a bit &#8220;amateur hour&#8221; in its approach, regarding &#8230;<\/p>\n<ul>\n<li>premature, and too simple, (textbox) onblur event programmatical form submit button clicking logic &#8230; <font size=1>and now we check on answer length<\/font><\/li>\n<li>number (in fact, all) characters were accepted as legitimate &#8220;word answer&#8221; characters &#8230; <font size=1>and now we allow keyboard numeric <a target=_blank title='Hotkey' href='https:\/\/javascript.info\/keyboard-events'>&#8220;hotkeys&#8221;<\/a> focus that player&#8217;s textbox, via &#8220;onkeydown&#8221; keyboard event logic &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n function isitnum(event) {<br \/>\n  if (eval('' + event.keyCode) &gt;= 48 && eval('' + event.keyCode) &lt;= 57) {<br \/>\n    top.setgl(eval(-48 + eval('' + event.keyCode)));<br \/>\n    return false;<br \/>\n  }<br \/>\n  return true;<br \/>\n }<br \/>\n&lt;\/script&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n<\/font><\/li>\n<li>players were referred to by number only &#8230; <font size=1>and now we allow for player name to be entered via a preceding (the question) span <i>contenteditable=true<\/i> element<\/font>\n<\/ul>\n<p> &#8230; meaning the one device (perhaps a mobile one) can have a hovering group of players who all see, for any multi-player game screen, the possibility to be answering via &#8230;<\/p>\n<ul>\n<li>click or tap of a button &#8230; to establish their textbox&#8217;s focus &#8230; and\/or &#8230;<\/li>\n<li>keyboard numeric hotkeys &#8230; to establish their textbox&#8217;s focus &#8230; and alpha letters to complete their answers<\/li>\n<\/ul>\n<p> &#8230; and once a player reaches the length of their answer, they can send that answer off for analysis via any of &#8230;<\/p>\n<ul>\n<li>that player tabs out of their textbox &#8230; or &#8230;<\/li>\n<li>that player clicks or taps their &#8220;Correct?&#8221; form submit button &#8230; or &#8230;<\/li>\n<li>a keyboard numeric for another player number is pressed<\/li>\n<\/ul>\n<p> &#8230; for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php--GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php--GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a> &#8230;<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_mobile.png\" style=\"width:100%;\"><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-player-equality-tutorial\/'>English Word Guessing Game Player Equality Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggpt'>Previous relevant <a target=_blank title='English Word Guessing Game Players Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-players-tutorial\/'>English Word Guessing Game Players Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Players Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_oldplayers.jpg\" title=\"English Word Guessing Game Players Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Players Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='English Word Guessing Game Primer Tutorial' href='#ewggpt'>English Word Guessing Game Primer Tutorial<\/a>&#8216;s &#8220;English Word Guessing Game&#8221; suited one player.   Today, we allow the user to set the number of players to &#8230;<\/p>\n<ul>\n<li>each nominated player plays within an HTML iframe element with an overall HTML table element within an HTML body element &#8230; meaning &#8230;<\/li>\n<li>until tomorrow&#8217;s work, it is &#8220;dog eat dog&#8221; as to who controls which player&#8217;s textbox has the focus &#8230; but &#8230;<\/li>\n<li>scoring is asynchronous<\/li>\n<li>until tomorrow&#8217;s work, the use of the tab character to tab out of a textbox clicks the &#8220;Correct?&#8221; button to go off to assess that player&#8217;s answer<\/li>\n<\/ul>\n<p>&lt;?php<br \/>\n<code><br \/>\n$score=0;<br \/>\n$goes=0;<br \/>\n$blurb='';<br \/>\n$dblurb=\"Score: 0\/0\";<br \/>\n$totalj=0;<br \/>\n$fortyeight=\"48\";<br \/>\n$fortyeighti=\"\";<br \/>\n$fortyeightj=\"\";<br \/>\n$ob=\"\";<br \/>\n$sh3=\"\";<br \/>\n$aic=\"Am I Correct?\";<br \/>\nif (isset($_GET['fortyeight'])) {<br \/>\n  $fortyeight=$_GET['fortyeight'];<br \/>\n  $fortyeighti=\"&lt;input type=hidden name=fortyeight value='\" . $fortyeight . \"'&gt;&lt;\/input&gt;\";<br \/>\n  $fortyeightj=\"&fortyeight=\" . $fortyeight;<br \/>\n  $aic=\"Correct?\";<br \/>\n  $ob=\" onblur=\\\" if (this.value.trim() != '') { document.getElementById('subm').click(); } \\\" \";<br \/>\n  $sh3=\" style='display:none;'\";<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['numplayers'])) {<br \/>\n  $preifs=\"&lt;html&gt;<br \/>\n&lt;head&gt;&lt;title&gt;What Is The English Word - RJM Programming - February, 2022&lt;\/title&gt;<br \/>\n&lt;\/head&gt;&lt;body style='background-color:yellow;'&gt;&lt;table style='width:100%;' border=20&gt;&lt;tr&gt;&lt;th colspan=2&gt;Player&lt;\/th&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;th&gt;Number&lt;\/th&gt;&lt;th&gt;Game&lt;\/th&gt;&lt;\/tr&gt;&lt;\/table&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  for ($ih=1; $ih&lt;=$_GET['numplayers']; $ih++) {<br \/>\n     $preifs=str_replace(\"&lt;\/table&gt;\", \"&lt;tr&gt;&lt;td style=text-align:center;&gt;\" . $ih . \"&lt;\/td&gt;&lt;td&gt;&lt;iframe src='.\/what_is_the_english_word.php?fortyeight=24' style='width:100%;height:200px;'&gt;&lt;\/iframe&gt;&lt;\/table&gt;\", $preifs);<br \/>\n  }<br \/>\n  echo $preifs;<br \/>\n  exit;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; the idea of the &#8220;fortyeight&#8221; code is to reduce the font size in order to fit in more player iframe display into the one shared screen, with <font color=blue>the user interfacing code<\/font> being &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;h3\" . $sh3 . \"&gt;RJM Programming <font color=blue>&lt;a title='How many players?' style='cursor:pointer;text-decoration:underline;' onclick=\\\" var hm=prompt('How many players?','1'); if (hm == null) { hm=''; } if (hm.trim().replace('1','') != '') { location.href=document.URL.split('?')[0].split('#')[0] + '?fortyeight=24&numplayers=' + encodeURIComponent(hm);  } \\\"&gt;<\/font>-<font color=blue>&lt;\/a&gt;<\/font> February, 2022&lt;\/h3&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-players-tutorial\/'>English Word Guessing Game Players Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggpt'>Previous relevant <a target=_blank title='English Word Guessing Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-primer-tutorial\/'>English Word Guessing Game Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.jpg\" title=\"English Word Guessing Game Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Primer Tutorial<\/p><\/div>\n<p>Ever so simple!  Is that what you want in a Word Game?   We like that, but we also like to learn words that might be new to us.  How about a &#8230;<\/p>\n<ul>\n<li>English word game &#8230;<\/li>\n<li>based on Linux or unix or macOS dictionary list &#8230;<\/li>\n<li>randomly choosing &#8230;\n<ol>\n<li>word length between 5 and 12<\/li>\n<li>a letter in word<\/li>\n<li>that letter position in word<\/li>\n<\/ol>\n<\/li>\n<li>and a clue, thanks to <a target=_blank title='Thanks' href='http:\/\/crossword-solver.io\/clue\/'>https:\/\/crossword-solver.io\/clue\/<\/a><\/li>\n<\/ul>\n<p> &#8230; basis for our word game, today?  Well, it&#8217;s just &#8220;first draft&#8221; time for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php_GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>, but we think you might like to try it?!<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54888' onclick='var dv=document.getElementById(\"d54888\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/word\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54888' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54918' onclick='var dv=document.getElementById(\"d54918\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/players\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54918' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54923' onclick='var dv=document.getElementById(\"d54923\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/hotkey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54923' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54929' onclick='var dv=document.getElementById(\"d54929\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dropdown\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54929' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54933' onclick='var dv=document.getElementById(\"d54933\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mamp\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54933' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54940' onclick='var dv=document.getElementById(\"d54940\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intranet\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54940' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You might recall that in yesterday&#8217;s English Word Guessing Game MAMP Tutorial we had the temerity to use the word&#8230; nuance &#8230; or &#8220;not to look so dumb&#8221; regarding wise local web server (let&#8217;s say Intranet, today) macOS say interfacing. &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-intranet-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,15,37],"tags":[85,113,3287,234,326,1750,367,388,405,448,449,476,573,587,2469,624,714,2415,2178,744,861,2077,1705,1712,932,952,3908,997,1761,1022,2350,1866,1238,1319,1452,1453],"class_list":["post-54940","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-apache","tag-audio","tag-below-the-fold","tag-command-line","tag-dictionary","tag-document-root","tag-dropdown","tag-english","tag-exec","tag-focus","tag-fold","tag-game","tag-hotkey","tag-iframe","tag-innertext","tag-intranet","tag-local-web-server","tag-localstorage","tag-macos","tag-mamp","tag-onclick","tag-onfocus","tag-onkeydown","tag-onsubmit","tag-php","tag-player","tag-players","tag-programming","tag-prompt","tag-quiz","tag-say","tag-select","tag-table","tag-tutorial","tag-word","tag-word-game"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54940"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=54940"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54940\/revisions"}],"predecessor-version":[{"id":54947,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54940\/revisions\/54947"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}