Consider the following url based on a sporting event happening in the future:
http://www.example.com/file.php?1615=Submit
The 1615 in the url is the eventid. Now after the event has finishedthe page should not be viewable anymore.
Thus my question is how do I stop user from viewing the page if event has expired? Would something like this be my most efficient option using the following logic:
- Get event id from url assign to var $check
- Select event_date from events where event_id = $check
- If(date('Ymd') > event_date) then redirect user
Is there a more efficient way I can tackle this problem?