MyMammothTech Posted October 19, 2010 Share Posted October 19, 2010 I need a calendar that is setup if you select a date that is within a 7 days of the current date then a radio button the the page is not available to be selected. Link to comment https://forums.phpfreaks.com/topic/216242-if-date-equils-x-then-radio-button-disabled/ Share on other sites More sharing options...
turkman Posted October 19, 2010 Share Posted October 19, 2010 It would depend on how you are comparing the dates. The best way is unix timestamps. You would give the date its date value as a timestamp. Then have a variable $week = 60 * 60 *24 * 7; //seconds in a week $maxtime = $_SERVER['REQUEST_TIME'] + $week; $mintime = $_SERVER['REQUEST_TIME'] - $week; then if($timestamp > $maxtime && $timestamp < $mintime) // allow radio button. Link to comment https://forums.phpfreaks.com/topic/216242-if-date-equils-x-then-radio-button-disabled/#findComment-1123811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.