Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $subjects=array("Math","Science","English","History");
- function createDropdown($arr, $frm) {
- echo '<select name="'.$frm.'" id="'.$frm.'"><option value="">Select oneβ¦</option>';
- foreach ($arr as $key => $value) {
- echo '<option value="'.$value.'">'.$value.'</option>';
- }
- echo '</select>';
- }
- ?>
- <h2> "User Form 1" </h2>
- <form id="form1" name="form1" method="post" action="form2.php">
- <table cellpadding="3">
- <tr><td>First Name:</td>
- <td><input type="text" name="FirstName"></td>
- </tr>
- <tr><td>Last Name:</td>
- <td><input type="text" name="LastName"></td>
- </tr>
- <tr><td>Student ID:</td>
- <td><input type="text" name="StudentID"maxlength='9'></input></td>
- </tr>
- <tr>
- <td>Grade:</td>
- <td>
- <input type="radio" name="grade" value="9">9</input>
- <input type="radio" name="grade" value="10">10</input>
- <input type="radio" name="grade" value="11">11</input>
- <input type="radio" name="grade" value="12">12</input>
- </td>
- <tr><td>Subject Mark:</td>
- <td>
- <label for="frmsubjects"></label>
- <!--?php createDropdown($subjects, 'frmsubjects'); ?-->
- <?php
- //Array contents array Subjects :: value
- $Subjects = array('Select a Course','Math','Science','English','History');
- //Values from Subjects array
- echo'<select name="Words">';
- //for each value of the array assign a variable name word
- foreach($Subjects as $word){
- echo'<option value="'.$word.'">'.$word.'</option>';
- }
- echo'</select>';
- ?>
- </td>
- <td>
- <select name = "mark">
- <option value = "x"> Select a mark </option>
- <?php
- for ($i=0;$i<101;$i++)
- {
- echo "<option value=\"".$i."\">".$i."</option>";
- }
- ?>
- </select>
- </td>
- <tr><td>Subject Mark:</td>
- <td>
- <label for="frmsubjects"></label>
- <!--?php createDropdown($subjects, 'frmsubjects'); ?-->
- <?php
- //Array contents array Subjects :: value
- $Subjects = array('Select a Course','Math','Science','English','History');
- //Values from Subjects array
- echo'<select name="Words">';
- //for each value of the array assign a variable name word
- foreach($Subjects as $word){
- echo'<option value="'.$word.'">'.$word.'</option>';
- }
- echo'</select>';
- ?>
- </td>
- <td>
- <select name = "mark">
- <option value = "x"> Select a mark </option>
- <?php
- for ($i=0;$i<101;$i++)
- {
- echo "<option value=\"".$i."\">".$i."</option>";
- }
- ?>
- </select>
- </td>
- </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement