Formular s multivalued params
Honza Pazdziora
adelton na informatics.muni.cz
Pondělí Listopad 15 22:31:33 MET 1999
On Mon, Nov 15, 1999 at 06:48:58PM +0100, Pavel Kunc wrote:
> Dobry den,
>
> chtel bych se zeptat proc nefunguje nasledujici script tak jak by snad mel
> tedy, ze by mel tisknout "author LIKE shakespeare AND author LIKE goethe
> AND. ........", ale tiskne jen prvni spojeni tedy "author LIKE shakespeare".
>
> use CGI;
> $query = new CGI;
> %Pary;
> for (@names) {$Pary{$_} = $query->param($_);}
>
> $sql = join ' AND ', map{$_.' LIKE '.$Pary{$_};} sort keys %Pary;
>
> print "Content-type: text/html", "\n\n";
> print "$sql", "<br>", "\n";
> exit (0);
A jak je inicializovany ten @names? Ja bych tim skriptem, tak Vam
vytisknu pouze
Content-type: text/html
<br>
zadnyho Shakespearea.
------------------------------------------------------------------------
Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain, ...
------------------------------------------------------------------------
Další informace o konferenci Perl