OK. So as I am developing a food log, now that I can successfully add a user's food eaten to the user_food table, I am now trying to also add a date_eaten field which records, as the name suggests :p, when the food was eaten.
For this I have implemented a javascript calendar sourced from - http://www.javascriptkit.com/script/script2/timestamp.shtml
However I am having trouble passing the date selected from the calendar to my MySQL table as it appears that the $_POST['timestamp'] is not returning a value.
Right, I have been working on my Food Log including my calendar, which now works, However I am having trouble passing the date selected from the calendar to my MySQL table as it appears that the $_POST['timestamp'] is not returning a value.
Notably these parts -
<td><form name="tstest" method="post"><input type="Text" name="timestamp" value="">
<a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="/joomla15/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>
</form>
$add_food_eaten = mysql_query("INSERT INTO user_food (food_id, user_id, date_eaten) VALUES ('".$_POST[foodnum]."', ".$user->id.", '".$_POST[timestamp]."')") OR die(mysql_error());
I have also tried adding a hidden field but this doesn't seem to work either.
My full module code is available here - http://rafb.net/p/XaqUtB47.html
Any ideas how I could get this to pass the value in the text field? I've tried a number of methods but nothing seems to be working at the moment.
Thanks in advance.