mardi 31 mars 2015

How to POST form data from within a table to PHP

I currently have a Timesheet form I am creating for the employees at my work and I am stuck at getting the input values to post correctly. I have a database set up but right now, I can't even get the values to show in a .php page. Here is a sample from my current table:



<html>
<form method="POST" form action="result.php">
<table>
<tr><td><b>Day of Week</td><td><b>Week 1 Hours</td><td><b>Week 2 Hours</td> <td>
<tr><td>Monday</td><td>
<input type="text" name="Monday" size="3" maxlength="4" value="" onkeypress="return inputLimiter(event,'Numbers')">
<input type="checkbox" tabindex="-1" name="Stime1">Sick?<input type="checkbox" tabindex="-1" name="Vac1">Vacation?</td>
<td><input type="text" name="Monday2" size="3" maxlength="4" value="" onkeypress="return inputLimiter(event,'Numbers')">
<input type="checkbox" tabindex="-1" name="Stime2">Sick?<input type="checkbox" tabindex="-1" name="Vac2">Vacation?</td></tr>
</table>
<input type="submit" value="submit">
</html>


This pattern continues for each day of the week. And then when I try to view the results of the post I couldn't get anything to work. I resorted to trying:



<html>
<?php var_dump ($_POST);
?>
</html>


All I get is a blank page, and if I view source it just shows the php code used. It's late here so I must be too tired and missing something but I just can't figure it out. Any and all help is much appreciated.


Thanks!


Aucun commentaire:

Enregistrer un commentaire