How to make sure a page only available for a period of time

I’m doing a project recording the attendance of the students using html, php and js. The students should not be able to record their attendance after some time.

I’m struggling to find a way to make sure the page that records the attendance should not be available after the set time. The period should be a user input. Hope I’ll be assisted on this. Thanks