studgate Posted March 10, 2008 Share Posted March 10, 2008 Hi Guys, I have a small problem. I am trying to create an expiration date for a form meaning that after a certain date, people will no longer be able to register anymore. Anybody knows of a way to do that or a tutorial that can help me with that? For example, I have an event that start in April 1st and people can register now to March 26th, after the 26th the registration will echo an error message or become inactive. Thanks in advance guys! Link to comment https://forums.phpfreaks.com/topic/95475-help-with-registration-form-expiration-date/ Share on other sites More sharing options...
p2grace Posted March 10, 2008 Share Posted March 10, 2008 You would simply do a check prior to showing the form. If the current date is within the allowed registration time then show the form, if it isn't show the message. Simple Example: $date = date("Ymd"); if($date < "20080315"){ // assuming you want it to close on March 15, 2008. You can set this to whatever you want // show form }else{ // hide form } Link to comment https://forums.phpfreaks.com/topic/95475-help-with-registration-form-expiration-date/#findComment-488733 Share on other sites More sharing options...
studgate Posted March 10, 2008 Author Share Posted March 10, 2008 Thanks p2grace, I am going to try that and see what I get. Link to comment https://forums.phpfreaks.com/topic/95475-help-with-registration-form-expiration-date/#findComment-488874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.