Link to home
Start Free TrialLog in
Avatar of deharvy
deharvy

asked on

HTML Checkboxes in PHP Script Stored in SQL DB

I want to add checkboxes to my PHP page. I need help with the following:

1) What 'type' should the SQL entries be? (test1, test2, test3)
2) Can you validate that my HTML table is correct?
<table>
 <tr>
  <td>
   <form name='examples' method='POST' action="test.php">
    <input type="checkbox" name="test1"<?php if($item['test1'] == "on"){echo" CHECKED";}?>>test1<br>
    <input type="checkbox" name="test2"<?php if($item['test2']== "on"){echo" CHECKED";}?>>test2<br>
    <input type="checkbox" name="test3"<?php if($item['test3'] == "on"){echo" CHECKED";}?>>test3<br>
    <input type="submit" name="submit" value="Submit">
   </form>
  </td>
 </tr>
</table>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of albuitra
albuitra
Flag of Colombia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial