Gossamer Forum
Home : Products : DBMan : Installation :

Bypass html_home

Quote Reply
Bypass html_home
Is there a way to bypass the html_home part of the script, so that when the user enters and he has a record it diplays the record, if not it displays the add form?


------------------
Quote Reply
Re: Bypass html_home In reply to
I'm sure there is a way. I haven't tested this, but you might give it a try.

In db.cgi, change the line

elsif ((keys(%in) <= 2) &#0124; &#0124; ($in{'login'})) { &html_home; }

to

elsif ((keys(%in) <= 2) &#0124; &#0124; ($in{'login'})) { &user_entry; }

Then, at the end of db.cgi, add the following subroutine:

sub user_entry {
$in{'userid'} = $db_userid;
my ($status, @hits) = &query("view");
if ($status eq "ok") {
&html_view_success(@hits);
}
else {
&html_add_form;
}
}


Of course, you would change userid to whatever the you've called the field.

I haven't tested it out, so I'm not guaranteeing anything, but it seems like it should work. Please let me know. Smile




------------------
JPD
Quote Reply
Re: Bypass html_home In reply to
That works perfectly. I am almost done now, all I need to do is change a little html so that it looks pretty, and then everyone will be able to have a custom homepage ala Yahoo!
Thanks for your help.
Mike


------------------