Saiv Posted September 19, 2013 Share Posted September 19, 2013 please help , I want the feild highlighted before 1 month till the expiry date. Link to comment https://forums.phpfreaks.com/topic/282275-highlight-feild-before-1-month-of-expiry/ Share on other sites More sharing options...
Barand Posted September 19, 2013 Share Posted September 19, 2013 Then you need to subtract a month from the expiry date and check if today is between that date and the expiry date Link to comment https://forums.phpfreaks.com/topic/282275-highlight-feild-before-1-month-of-expiry/#findComment-1450211 Share on other sites More sharing options...
Saiv Posted September 19, 2013 Author Share Posted September 19, 2013 CAN YOU PLEASE CHECK THIS CODE, IT IS NOT WORKING.. $today=Date('Y-m-d'); $date = $row[3]; //hosting_renewdate $remainder_date = strtotime ( '-30days' , strtotime ( $date ) ) ; $remainder_date = date ( 'Y-m-d' , $remainder_date ); list($year1,$month1,$date1)=split('[/.-]',$row[3]); $renew_date=$year1."-".$month1."-".$date1; if(($today==$remainder_date) && $today<=$renew_date) echo " <tr bgcolor=yellow><td>$cnt</td><td>$row[0]</td><td>$row[1]</td><td>$hosting_renewdate</td></tr>"; else echo " <tr bgcolor=white><td>$cnt</td><td>$row[0]</td><td>$row[1]</td><td>$hosting_renewdate</td></tr>"; Link to comment https://forums.phpfreaks.com/topic/282275-highlight-feild-before-1-month-of-expiry/#findComment-1450223 Share on other sites More sharing options...
Barand Posted September 19, 2013 Share Posted September 19, 2013 your date range test should be if(($today>=$remainder_date) && $today<=$renew_date) Link to comment https://forums.phpfreaks.com/topic/282275-highlight-feild-before-1-month-of-expiry/#findComment-1450224 Share on other sites More sharing options...
Saiv Posted September 19, 2013 Author Share Posted September 19, 2013 Yes It is working, Thank you very very much............ Link to comment https://forums.phpfreaks.com/topic/282275-highlight-feild-before-1-month-of-expiry/#findComment-1450225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.