Hi,
I am creating dynamic form and fields on the fly with values coming from a DB. My issue is that I am not able to post the listed field values to the next page.
I know I have to use a for loop with an array identifying each field within the form.
Would really appreciate if someone could guide me on this.
<?
$query = "SELECT * FROM registerData WHERE email_add = '$emailAdd'";
$result = mysql_query($query);
echo "<table border='1' width='700' style='position : absolute; top:330px; left : 50px;'>";
echo "<tr><th>ID</th><th>School Name</th><th>Class/Division</th><th>Child's Name</th><th>Application Status</th><th>LaunchApp</th></tr>";
While ($row = mysql_fetch_array($result))
{
echo "<Form name='LaunchApp' method='POST' action='test.php'>";
echo "<tr><td>";
$policyID1 = $row['policygen'];
echo "<input type='text' name='policyID1' size='4' disabled='true' value ='$policyID1'>";
echo "</td><td>";
$schoolname1 = $row['school_name'];
echo "<input type='text' name='schoolname1' size='4' disabled='true' value ='$schoolname1'>";
echo "</td><td>";
$classDiv1 = $row['class_div'];
echo "<input type='text' name='classDiv1' size='4' disabled='true' value ='$classDiv1'>";
echo "</td><td>";
$childname1 = $row['child_name'];
echo "<input type='text' name='childname1' size='4' disabled='true' value ='$childname1'>";
echo "</td><td>";
$emailAdd1 = $row['email_add'];
echo "<input type='text' name='emailAdd1' size='10' disabled='true' value ='$emailAdd1'>";
echo "</td><td>";
echo "<input type='submit' name='startpolicy' value='Go'>";
echo "</td></tr></form>";
}
echo "</table>";
?>
test.php
<?
session_start();
$emailAdd1 = $POST['emailAdd1'];
$policyID1 = $POST['policyID1'];
echo $emailAdd1;
echo $policyID1;
?>