Apr 16th 2015, 10:26:10
**Under Construction**
** save as celphi.php
<html>
// creates text box and create poll button
<form method="POST" name="pollbox" action="celphi2.php>
<p>Enter Poll Question:</p>
<input type="text" name="poll_Q">
<p>Select # of Questions:</p>
<input type="submit" value="Create Poll">
</form>
<?php
// creates drop box with #s 1-5 (which allows user to create up to 5 answers)
echo "
echo "<select name=\"ans\">";
for ($ans=1; $ans<=5; $ans++) {
echo "<option value=\"$ans\">$ans</option>\n";
}
echo "</select>";
?>
</html>
==================================================================================
*** celphi2.php
<html>
<?php
// grabs # of answers from dropbox from celphi.php
$ans = $_POST["ans"];
// creates textboxes for answers equal to number selected in drop box
echo '<form method="POST" name="dropbox2">';
For ($c=0; $c < $ans; $c++) {
echo '<input type="text" name=$choice[$c]>' . '<br>';
}
echo '</form>';
// create radio buttons equal to the # selected in dropbox
For ($c = 0; $c < $ans; $c++) {
echo '<input type="radio" name="ans[$c]" value="ans[$c]">' . $choice;
}
?>
</html>
*********
I haven't tested it because I'm just blindly typing it into this box, but that's your HTML portion using some PHP to populate combo box and textboxes. The only part missing is the recording the results to file and retrieving which i'm not sure if you'll be saving to MYSQL or to disk.
*********
Edited By: Celphi on Apr 16th 2015, 11:09:45. Reason: [ Irrelevant ]
Resistance is futile. You will be assimilated.