Home > front end >  how to allow user to input data only in first 7 day of month
how to allow user to input data only in first 7 day of month

Time:09-23

i have create a web form to get monthly production of producers in each month. i ask them to input their previous month production data to web form in next month. i get data entered data as follows

$entreddate = date("Y-m-d");
date_default_timezone_set("Asia/colombo");

$enteredtime = date("H:i:s");`

then i get month from that date and -1 to get previous month.

but they feed data every day in next month and i was unable to finalize last month production until end of this month. is there any method to allow user to open web form only in first 7 days of next month.

CodePudding user response:

1 -> get current date
2 -> check if it is greater than 7
3 -> if it is don't open the form otherwise open it

Hope that helps do let me know if it does not.

Thanks Sagheer

  •  Tags:  
  • php
  • Related