Please note that within the code samples, all external function calls or class names start with the prefix EXT.
The logical design of this front-end is to start with a login/welcome screen:
";
exit (1);
}
// now based on the access level show a new form that will have selections to
// query the database. Also, note that based on the access level the 'action'
// taken on that form (the next level CGI program built using MorphCGI, that
// will do the actual querying of the database) will be different. This in
// essence is 'on-the-fly content generation', which could be extended to
// any depth within the application domain.
switch (accessLevel)
{
case ACCESS_ADMIN:
// this will generate HTML tags for a FORM that will have querying
// selections (predicates) for an admin
// ie. it would have
In such a case, using a little ingenuity and the MorphCGI class library, we can handle this easily with one common CGI program:
Administrator Preferences
Manager Preferences
User Preferences
Now as seen from above, all the three FORMS's are handled by a common CGI agent, viz. 'Pref.cgi':