Location: PHPKode > scripts > Define Word > define-word/guessWhat.php
<?php
include_once("DefineWord.class.php");

// place here any number or type of words 
$wordArray =  Array("thread","love","swing","echo","movement","swallow","parse","document","feature","obsticle","parrot","shake","taste");
$numOfWords = count($wordArray);
$rand=rand(1,$numOfWords);
$wordToDefine = $wordArray[$rand];
$myDict = new DefineWord($wordToDefine,"dict.org",3,"short");

echo "Try to guess which word has the following definition(s): <br>";
$myDict->print_def_array("game"); 

echo "<br>";
echo '<input type="hidden" name="hidden_word" value="'.$wordToDefine.'">';
echo '<input type="input" name="guess"><input type="button" value="Enter..." OnClick="Javascript:alert(document.all.guess.value==document.all.hidden_word.value);">';
echo '<input type="button" Value="I give up (let me know)" onClick="Javscript:alert(document.all.hidden_word.value);"><br>';
echo '<input type="button" Value="Start Over" Onclick="Javascript:window.history.go(0);">';

			
?>




Return current item: Define Word