Getting the date from a html date input type to a php variable on a
different page
I have been trying to make a system for my school and some of the code is
giving me a problem. i have a teachers page on which i input some details
from a database and give a radiobutton with each record. when the user
clicks submit it is supposed to go to a different page and put only the
records into a differnt table for which the radiobutton was checked. it
will put the the dates that the user has entered into a differnt table.
The code for making the date input is
$c=5;
$sd=7;
$ed=11;
echo "<tr> <td>Name</td><td>Number</td><td>Form </td><td> Outings
left</td><td>Night outings left</td> <td>Allowed</td><td>Start
date</td><td>End Date</td></tr>";
while($row=mysql_fetch_array($sqlquery))
{
echo "<tr> <td>$row[Name]</td><td>
$row[Number]</td><td>$row[Form]</td><td>
$row[Outings_left]</td><td>$row[Night_outings_left]</td> <td><input
type='checkbox' id='$c' name=' $c' value='checked' /></td><td><input
type='date' id='$sd' name='$sd' /></td><td><input type='date' id=' $ed '
name=' $ed' /></td></tr>";
$arr= Array($n=> Array(1=>'row[name]', 2=> 'row[number]') );
$c+=5;
$sd+=7;
$ed+=11;
}
i am trying to read the entered dates in the following way but is not
working properly. i just doesnt enter anything into the variable
$c=5;
$sd=7;
$ed=11;
for ($ca=1;$ca<$total;$ca++)
$startdate=$_POST['$sd'];
echo $startdate;
$enddate=$_POST['$ed'];
No comments:
Post a Comment