Hello. I am trying to edit my event registration site so that after the registration cut off date, the link will no longer be valid and it will display "registration closed" I cannot figure out the syntax error here.

if ($registerend < NOW()){
print "Registration has ended";
print " <a href=\"/registration/new/register.php?id=<?php echo $event["id"]?>\">Click Here to Register</a>;

Any suggestions?

9 Years
Discussion Span
Last Post by jzimmerman

It looks as if you have tried to embed a PHP statement within a section of PHP code. On the last Print statement you don't need:
...<?PHP echo ...?>...
...php?id=".$event["id"]."\"> ...


NOW() is an sql mysql mssql function not a php fuction in php time() is now
as well as the slightly buggy print code

if ($registerend < time()){
print "Registration has ended";
print " <a href='/registration/new/register.php?id=".$event['id']."'>Click Here to Register</a>";
} ?>

Its possibly more portable, for more than one event running at close to the same times, to use the event array to hold all the relevant data for each event

if ( $event['registerend'] <time()) {/* code */ }

well I hope you get busy enough to need more than one event running at a time


Thank you! It is working perfectly.

We are getting to the point where end dates are getting close.

Thank you again.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.