Gossamer Forum
Home : Products : DBMan : Installation :

Greeting from userid and database

Quote Reply
Greeting from userid and database
I would like to put a greeting on the pages once a user logs in. The username from the login is a field in my database. Based on that field, I would like to display something like "Greetings {First_Name}" where {First_Name} is another field and is based on a search of the database for the username. I hope this explains what I need.
Quote Reply
Re: Greeting from userid and database In reply to
In sub html_home, right at the beginning, add

Code:
$in{$db_cols[$auth_user_field]} = $db_userid;
my ($status, @hits) = &query("view");
if ($status eq 'ok') {
%rec = &array_to_hash(0,@hits);
}

Then, in the place where you want to print out the user's name, use (within a print statement)

Code:
Greetings, $rec{'First_Name'}


------------------
JPD






Quote Reply
Re: Greeting from userid and database In reply to
Thanks again, that did the trick.