This topic is locked

Cancel Inline Add

2/7/2013 5:47:22 AM
PHPRunner General questions
G
GunnySJB author

**I have a master table with lessons and a details table where people can enroll. Now i want when the maximum number of student is reached that the next person gets a message no more place to enroll.
I have this script in my BEFORE RECORD ADDED
if($record["Inschrijvingen"] < $record["max_aantal"])

{

$values['UserId']= $_SESSION["UserID"];

$values['cf_ipaddress'] = $_SERVER['REMOTE_ADDR'];

return true;

}
Else

{

echo "<script>alert('The is no more place to enroll')</script>";

return false;

header("Location: interne_vormingsreeksen_list.php?a=return");

exit();

}
The user gets the message but still has to click on the cancel button and gets a error message and has to go back to the master table.

I want that when the maximum is reached just the message and then redirect to master page without any interaction.

Is this possible ?
Thanks for any suggestions

Gunther