searls03 Posted March 28, 2011 Share Posted March 28, 2011 ok, so I have this code for my event registration page......I need to make this event register button dissapear after the date has passed.......can I do this using dd/mm/yyyy or do i need yyyy-mm-dd? here is the codeif ($reg_end == date("F",strtotime("+1 month"))){ echo "<form action='registration.php' method='get'><input type='hidden' name='eventid' value='{$row['eventid']}'><INPUT TYPE='submit' name='submit' VALUE='Register'></form>\n";} else{echo "No longer accepting registrations";} also I need to know how to modify the red code to do this........thanks in advance.......btw I will have field call reg_end which is when the turn off date is....... Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/ Share on other sites More sharing options...
cssfreakie Posted March 28, 2011 Share Posted March 28, 2011 use code tags dude, this is one big chaos and have a look here: http://www.phpfreaks.com/tutorial/working-with-dates-in-php We have quite some tutorials here that are pretty useful. Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193464 Share on other sites More sharing options...
searls03 Posted March 28, 2011 Author Share Posted March 28, 2011 sorry, i needed to make the piece that I needed to show red...... Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193466 Share on other sites More sharing options...
cssfreakie Posted March 28, 2011 Share Posted March 28, 2011 sorry, i needed to make the piece that I needed to show red...... instead of red, you can use php comments //this is a comment Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193471 Share on other sites More sharing options...
codefossa Posted March 28, 2011 Share Posted March 28, 2011 <?php $end_date = strtotime('29 March 2011'); if (time() < $end_date) { echo $end_date; } ?> Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193472 Share on other sites More sharing options...
rondog Posted March 28, 2011 Share Posted March 28, 2011 You almost got it <?php $end_date = strtotime('29 March 2011'); if (time() < $end_date) { //show your form } else { //registration is over } ?> Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193476 Share on other sites More sharing options...
codefossa Posted March 28, 2011 Share Posted March 28, 2011 You almost got it All he needed was the if statement, so I didn't even pay attention to the rest. Link to comment https://forums.phpfreaks.com/topic/231993-disable-register-form/#findComment-1193479 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.