koacamper has asked for the wisdom of the Perl Monks concerning the following question:
I only want the "company" pulled from the database and listed in the drop-down. Here's what I've done so far:company1|www.company1.com|absolute_path1 company2|www.company2.com|absolute_path2 company3|www.company3.com|absolute_path3 etc...
Thank you all for any help that you can give me.#!perl use strict; use CGI; $|=1; my $db="g:/Scripts/Indigo/cgi-bin/company.db"; my $query=new CGI; my $g_debug=0; my $path='g:/Scripts/Indigo/cgi-bin/'; my $rc=0; my ($u,$p); my $userid=$query->param('userid'); my $url=$query->param('url'); # open the text database unless(open(PFD,$db)) { &printError("Could not open user database"); return; } # first check if user exist $path=''; while (<PFD>) { chomp; ($u,$p,$path)=split('\|',$_);###$u loop?? how? if ($userid eq $u) { $rc=1; last; } } close(PFD); print $query->popup_menu(-name=>'userid', -values=>[$u]);## $u needs loop to pull al +l company entries from $db
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Drop Down Selection #2
by suaveant (Parson) on May 08, 2001 at 21:28 UTC | |
by koacamper (Acolyte) on May 09, 2001 at 01:18 UTC | |
by suaveant (Parson) on May 09, 2001 at 06:25 UTC | |
by tilly (Archbishop) on May 09, 2001 at 11:39 UTC | |
by koacamper (Acolyte) on May 09, 2001 at 06:35 UTC |