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....... Quote Link to comment 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. Quote Link to comment 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...... Quote Link to comment 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 Quote Link to comment 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; } ?> Quote Link to comment 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 } ?> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.