Markx Posted September 25, 2008 Share Posted September 25, 2008 Hi All I hope you can help. I'm trying to input data into a table cell based on a value inputted into a text field. The textfield asks for a date. From that the table needs to display the days of the week, so if someone entered 25/9/08 it would have Thursday in column 1, Friday in colum 2 etc. Also, on the second row it would display the date, so 25/9/08 in column 1, 26/9/08 in column 2 etc. I hope this makes sence ??? Thanks Mark Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/ Share on other sites More sharing options...
adam291086 Posted September 25, 2008 Share Posted September 25, 2008 What coding have you got so far? you will need to look into things like http://www.w3schools.com/php/php_ref_calendar.asp Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/#findComment-650343 Share on other sites More sharing options...
Markx Posted September 25, 2008 Author Share Posted September 25, 2008 Hi Adam The only coding I've got is <form name="form1" id="form1" method="post" action=""> Name: <input type="text" name="textfield" /> <br /> First Date back to work: <input type="text" name="textfield3" /> <br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> Not sure what I'm going to do about the date format :'( Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/#findComment-650344 Share on other sites More sharing options...
Snooble Posted September 25, 2008 Share Posted September 25, 2008 echo the varialbe in the first field, in the next echo the variable +1. etc. so - find the name of the field they enter the information in - for example - date - find method of sending info, POST or GET. then: $date = $_POST['date']; or $date = $_GET['date']; echo it in the cell you want, followed by using http://www.w3schools.com/php/php_ref_calendar.asp to help you with days and incrementing the variable. Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/#findComment-650498 Share on other sites More sharing options...
Markx Posted September 26, 2008 Author Share Posted September 26, 2008 Hi Snooble. That's perfect, just what I was looking for. However, It always seems to come out in MMDDYYYY format and I need it in DDMMYYYY format. Any ideas? Thanks Markx Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/#findComment-651343 Share on other sites More sharing options...
Andy17 Posted September 27, 2008 Share Posted September 27, 2008 However, It always seems to come out in MMDDYYYY format and I need it in DDMMYYYY format. Any ideas? <?php echo date("d/m/y"); ?> Link to comment https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/#findComment-651768 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.