fireslug Posted July 8, 2009 Share Posted July 8, 2009 I would really appreciate help from anyone who can tell me how to permit a user to enter an end date, and have it accepted by the system. Currently a customer can enter a start date, but if they enter an end date that is in the same month as the start date, the system reports "select an end date greater than current date", which is ridiculous considering that any date after the start date is greater than the start date. I look forward to any help I can get. Ric Link to comment https://forums.phpfreaks.com/topic/165219-correct-an-end-date-problem/ Share on other sites More sharing options...
gevans Posted July 8, 2009 Share Posted July 8, 2009 Have you written the code youself? If so change the way you compare the data to check day as well as month/year. Any code we can see? Link to comment https://forums.phpfreaks.com/topic/165219-correct-an-end-date-problem/#findComment-871254 Share on other sites More sharing options...
fireslug Posted July 9, 2009 Author Share Posted July 9, 2009 Hi Gareth, I have no idea of what part of the code has the problem, but here's what i think is the area where the code resides. <form action="relist.php" method="POST"> <table border="0" cellpadding="0" width="100%" cellspacing="0" height="221" style="border-collapse: collapse; border: 1px solid #3366FF" bordercolor="#111111" bgcolor="#ffffff"> <tr> <td width="100%" bgcolor="#6666FF" height="32"> <p align="center"><b><font face="Verdana" size="3" color="#FFFFFF">Your Recent Specials <?=titleCase($uid)?> - <?=titleCase($sbrb)?> </font></b></td> </tr> <tr> <td width="100%" height="35" valign="middle" bgcolor="#FFFFFF" align="center"><input type="submit" value="Re-List Item" style="background-color: #FFFFFF; border-style: solid; border-width: 1"> </td> </tr> <!--Start Print data--> <? $dt= date('Y-m-d'); $sql="select * from post_special where userid='$uid' and status='s'"; //echo $sql; $i=1; $res_1= mysql_query($sql) or die('$sql<br>Error---->'.mysql_error()); While ($row_2=mysql_fetch_array($res_1)) { $uid=$row_2['userid']; ?> <tr> <td width="100%" height="21" bgcolor="#E1E1FF"> <Table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff"> <tr> <td width="37%" bgcolor="#E1E1FF"> </td> <td width="5%" bgcolor="#E1E1FF"> </td> <td width="33%" bgcolor="#E1E1FF" class="suburb1"> </td> <td width="25%" bgcolor="#E1E1FF" class="suburb1"> </td> </tr> </table> </td> </tr> <tr> <td width="100%" height="21"> <table border="0" cellpadding="0" width="100%" cellspacing="0" bgcolor="#ffffff"> <tr> <td width="2%" valign="top" style="border-right: 1 solid #FFFFFF" align="center"> </td> <td width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="0" height="85" bgcolor="#ffffff"> <tr> <td width="12%" rowspan="3" valign="top" class="suburb1"><table width="85" height="63" border="0" bgcolor="#ffffff"> <tr> <td width="79" scope="col"><a href="uploadimage.php?id=<?=$row_2[0]?>" class="suburb1"> <?php $smallImage = "No_image.jpg"; $filename = ""; if($row_2['smallImage']!="") { $filename = "pics/photo/"."t_".$row_2['smallImage']; if(file_exists($filename)) $smallImage = "t_".$row_2['smallImage']; } ?> <img border="0" src="pics/photo/<?=$smallImage?>" width="75" height="75" align="center"></a></td> </tr> </table></td> <td width="88%" height="23" class="suburb1"><input type="checkbox" name="n<?=$i?>" value="<?=$row_2['id']?>"> <? echo titleCase($row_2['product']);?></td> </tr> <? $i=$i+1; $date1 = explode('-',$row_2['sdate']); $dd= $date1['2']; $mm= $date1['1']; $yy= $date1['0']; $date1 =$mm."/".$dd."/".$yy; $dt=date('D, d M Y',strtotime($date1)); $date1 = explode('-',$row_2['edate']); $dd= $date1['2']; $mm= $date1['1']; $yy= $date1['0']; $date1 =$mm."/".$dd."/".$yy; $dt1=date('D, d M Y',strtotime($date1)); ?> <tr> <td height="3" class="content2">Start Date: <?=$dt?> - End Date: <?=$dt1?></td> </tr> <tr> <td height="18"><span class="suburb1">Normal Price : <? echo "$".$row_2['nprice'];?> Special Price : <? echo "$".$row_2['sprice'];?></span></td> </tr> <tr> <td height="26" colspan="2" class="content2">*Click on image for change or delete </td> </tr> </table> </td> </tr> </table> <? } ?></td> </tr> </table> If you can help or offer some advise, I will be most appreciative. Cheers Ric Link to comment https://forums.phpfreaks.com/topic/165219-correct-an-end-date-problem/#findComment-872173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.