Hi
I am trying to make a script that updates a hidden feild with a week number of a date wich I type in a textfield, and submits to the database.
I keep getting the error message: Warning: mktime() expects parameter 4 to be long
The script looks like this:
The point with it is that I don't want to have a static date, I want it to be dynamic and that has turn my hair grey
Can some one please help me?
Best Regards
Jimmy
I am trying to make a script that updates a hidden feild with a week number of a date wich I type in a textfield, and submits to the database.
I keep getting the error message: Warning: mktime() expects parameter 4 to be long
The script looks like this:
| Code: |
| <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="left"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Fooddate:</td> <td><input type="text" name="Fooddate" value="<?php echo date('m-d-Y'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Meal:</td> <td><input type="text" name="Meal" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="Insert record" /></td> </tr> </table> <input type="hidden" name="Transact_ID" value="" /> <input type="hidden" name="Emp_no" value="<?php echo $row_employee['no']; ?>" /> <input type="hidden" name="C_Date" value="<?php echo date('m-d-Y'); ?>" /> <input type="hidden" name="U_Date" value="" /> <input type="hidden" name="U_User" value="" /> <input type="hidden" name="Company" value="<?php echo $row_employee['company']; ?>" /> <input type="hidden" name="Week" value="<?php echo $testvecka; ?>" /> <input type="hidden" name="MM_insert" value="form1" /> <?php $date = $_POST['Fooddate']; list($month, $day, $year) = split('[/.-]', $date); $testvecka = date('W', mktime(0, 0, 0, date($month) , date($day) , date($year))); ?> </form> |
The point with it is that I don't want to have a static date, I want it to be dynamic and that has turn my hair grey
Can some one please help me?
Best Regards
Jimmy
