Gossamer Forum
Home : Products : DBMan : Customization :

Auto Modify Screen from Default User after Login

Quote Reply
Auto Modify Screen from Default User after Login
Whew... I'm full of questions tonight... Here we go...

My database is set up so that a default user can view all records without loggin in. There is a modify/add button that really only takes them to a login screen using

Code:
<A HREF="$db_script_url\?modlog=1">Add/Modify My Listing</A>

(more on the \?modlog=1 in a second)

After a user logs in, they are automatically taken to an add screen if they don't already have a record in their name, on the home screen if they do. What I tried to was pass a switch in the static link to login in that would be pass along by means of hidden fields using

Code:
<input type=hidden name="modlog" value="$in{'logmod'}">

in the login form. So far, everything works. The variable logmod=1 is passthrough the system until it gets to:

Code:
if ($in{'modlog'} eq '1') {&html_modify_form($db_key{\*}); return;}

Take place to rediect them to the modify_form, while passing along the DB key. (And not the modlog variable). The only problem is that I think my code for passing the DB key is incorrect. I get a message saying that no search was defined. That's because I only need the key to be passed to bring back a valid search.

I think my logic in this is correct, but maybe my implementation is wrong.

Any ideas on how to pass this along to the modify subroutine?

Thanks!
Dave
Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
What is your key field? Is it the userid?



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





Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
Yes. The key field is the UserID. (Allows only one item in the database per user.)

-Dave
Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
You can't send a value to sub html_modify_form directly. You need to use something like

Code:
if ($in{'modlog'} eq '1') {
$in{$db_key} = $db_userid;
&html_modify_form;
return;
}


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





Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
Carol,

Thanks very much - again! That was what I needed.

-Dave
Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
You put the following codes:

Code:
if ($in{'modlog'} eq '1') {
$in{$db_key} = $db_userid;
&html_modify_form;
return;
}

in the html_home sub in the html.pl file.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Auto Modify Screen from Default User after Login In reply to
This message looks like it is very old, but it is exactly what I am trying to do. I want the user to go directly to the modify form if they already have a record, since I am limiting them to one record. The above posts don't go into much detail on doing this though. Can someone help out? Thanks.