I have this code and it should print labels with text boxes for people to fill in information. It takes a text like : $tokens = "*noun *noun *verb" and should print to the user a table that has :
Noun: (text box to be filled) Noun: (text box to be filled) verb: (text box to be filled) etc.
but it is not working
echo "<form action=\"storygenerated.php\" method=\"post\">
<input name=\"fields\" type=\"hidden\" value=\"$tokens\" />
<input name=\"story\" type=\"hidden\" value=\"$story\" />
<table>";
for ($i = 0; $i < count($tokenArray); $i++) {
$fieldWords = split('_',$tokensArray[$i]);
echo "<tr><td>";
echo $fieldWords[0];
for ($j = 1; $j < count($fieldWords); $j++) {
echo " ".$fieldWords[$j];
}
echo ":";
echo "</td><td><input name=\"$tokensArray[$i]\" type=\"text\" /></td></tr>";
}
which is from this code that is generating the text $tokens
$storyArray = split(' ', $story);
$tokens = ""; // space-delimited list of fields
$tokensArray=array();
for ($i = 0; $i < count($storyArray); $i++) {
if ($storyArray[$i][0] == '*') {
$tokens .= $storyArray[$i] . " ";
$tokensArray[] = $storyArray[$i];
}
}