Gossamer Forum
Home : Products : DBMan : Installation :

Admin Selection dilemma

Quote Reply
Admin Selection dilemma
Hi Guys,

I need some assistance regards the html selection setup please.

I have 4 html.pl files, but a common database. Each html.pl displays different products in a different manner.

Default users are no problem. For admin purposes, when a registered user logs in I want to allow the user a drop down select menu for add, delete, etc., but for a selected db spec.

Unless I am mistaken this is not as easy as a drop down selection, as once logged in the html.pl file is already defined and drop down menus only allow a value variable and not a name variable. In order to select the required edit facility I need the name to be selectable and not the value. I hope I am making sense.

Is there any way to fix an HTML form to do this?

Thanks in advance
Greg
Quote Reply
Re: Admin Selection dilemma In reply to
Hi Greg,

Quote:
I have 4 html.pl files, but a common database. Each html.pl displays different products in a different manner.
I am not sure that this is the best way to go about this. I think it would be easier to just have one .html file per database. The exception to this would be if you have more than one database and want to share some common output between them. Just make sure that your sub routines have unique names in relation to your .html files. They probably already do if your database is working correctly.

Quote:
Default users are no problem. For admin purposes, when a registered user logs in I want to allow the user a drop down select menu for add, delete, etc., but for a selected db spec.
Not sure what you mean by "db spec." but the drop down list could be done with a slight modification to sub main.

The HTML for your drop down list would look something like this:
<select name="drop_down">
<option value="add_form">Add</option>
<option value="delete_search">Delete</option>
<option value="modify_search">Modify</option>
</select>

Then before the first line of the long list of if and elsif statements in "sub main" of the db.cgi you would add the following:
if ($in{'drop_down'}) { $in{$in{'drop_down'}} = '1'; }


So let's say that we select "Add" from your drop down list, then $in{'drop_down'} would contain 'add_form'.
So $in{$in{'drop_down'}} would be the same as saying $in{'add_form'}. Then we just make $in{'add_form'} contain '1' so that it is not empty and can then be parsed through the rest of the if and elsif statements.

I didn't test this but it would be a easy enough to try.

Hope that helped.

Steve Plant




------------------
_____________________________________
OutreachONE Media Services
www.or1.com