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; } Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.