I am building a form where users must select a time interval, from day to day OR month to month or year to year or even a specific day in a month in a year to another date in time…I would use a JS calendar for it but I am unsure of what I would do to check if that specific date has arrive yet or not.
The user is suppose to choose a starting date and an ending date, the user makes certain changes once and those changes apply for the time interval a user has chosen, so once the end date is reached the changes no longer apply and the script is reset to its default…
These changes can be applied to the program, code in the program etc…But basically the program would allow these changes from the interval in time the user chooses on the form but once the date is reached everything is reset to default…
My original idea was to use PHP’s date(‘W’) function in order to get the start and end time from the user and store it, then have my script look up the date everyday to see if the end date has reached yet or not. Then my other ideas was to use JS’s calendar pop up to get the start and end date and have some sort of script look up the date everyday to see if the deadline has reached yet or not..But all these arent very reliable ways or methods so perhaps someone here has more experience with this…Cron jobs I am not very experienced with but I am not so sure how I would use php or js in the back end of my form to set a cron job for this..
I’d suggest you use a database to store your modified code / date range. You don’t need to worry about a cron job – just place a bit of code at the beginning of your script to check each time its run which version it should use.
Check for a current change in the database; if it exists, load up that modified script instead of the normal one.