Jeniveve Posted April 15, 2011 Share Posted April 15, 2011 Hi, I am trying to figure out how to stop my script from offering a discount when the date that is listed passes by. It seems to always 'reset' itself even after the 15th of the month...I want it to stop after April 15...This is what I had, can anyone assist? Thank you in advance for your help! Jennifer } if(date("n") < 15) { $before = $cost*.05; $before = round($before,2); $cost = $cost-$before; } Link to comment https://forums.phpfreaks.com/topic/233858-need-assistance-with-ending-discount-offer/ Share on other sites More sharing options...
blacknight Posted April 15, 2011 Share Posted April 15, 2011 ummm.. i know why its not working ... date('n') in php is month try using date("j") http://php.net/manual/en/function.date.php Link to comment https://forums.phpfreaks.com/topic/233858-need-assistance-with-ending-discount-offer/#findComment-1202187 Share on other sites More sharing options...
Jeniveve Posted April 15, 2011 Author Share Posted April 15, 2011 Thank you so very much!!! And I appreciate the link so I can learn more! Jennifer Link to comment https://forums.phpfreaks.com/topic/233858-need-assistance-with-ending-discount-offer/#findComment-1202188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.