I have a database that I call from with 2 tables, one is paragraph and the other called text. I have put all the paragraph fields as check boxes. When my users check certain boxes I want them to be able to click submit and then the correct text for the paragraphgs chosen is shown to them on the screen. How do I get this to work?!?!? my code is shown below:
$connection=mysql_connect($host,$user,$password)
or die("couldn't connect to server");
$db=mysql_select_db($database,$connection)
or die ("Couldn't select database");
$query = "select * from paragraph"
or die ("Couldn't execute query.");
$result = mysql_query($query)
or die ("Couldn't execute query.");
echo "<div style='margin-left:.3in'>
<p>
<p><b>Which paragraphs do you want?</b>
<p>Choose as many paragraphs as you like:\n";
/form for checkboxes/
echo "<form action='page3.php' method='post'>\n";
while ($row=mysql_fetch_array($result))
{
extract($row);
echo"<input type='checkbox' name='interest[$Paragraph]'
value='$Paragraph'>$Paragraph\n";
echo"<br>\n";
}
echo "<p><input type='submit' value='Submit final documentation'>
</form>\n";
foreach ($_post as $field =>$value)
{
echo "$field, $value<br>";
}
?>