if they get a 404 error, you have made a wrong link....
the code cannot produce a 404, but if you have misspelled a link that could appear
the last question: just add an ifclause: if($bbuserinfo[userupgradedate]>0) show_nopermission();
so as long as they have never been in group 21 the datevalue would be 0 so they can access the trial, but if they were in that group the datevalue is greater than 0 so they'll get a nopermission