Thread Select Liste ...: HTML::Template
(14 answers)
Opened by BlackExe at 2007-07-07 03:19
So würde es mit
![]() Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 #!/usr/bin/perl use strict; use warnings; use HTML::Template::Compiled; use CGI qw(param); use CGI::Carp qw(fatalsToBrowser); $CGI::DISABLE_UPLOADS = 1; my $auswahl = param('dateien'); my $dateiname; my $dir = "."; opendir(DIR, "$dir") or die("Fehler beim Öffnen: $!"); my @dateien = grep /\.dat$/, readdir(DIR); closedir(DIR) or die("Fehler beim Schließen: $!"); print CGI::header(); my $t = HTML::Template::Compiled->new( filehandle => *DATA); $t->param(dateien => \@dateien, auswahl => $auswahl); print $t->output; __DATA__ <html> <head> <title>Test</title> </head> <body> <form action="" method="post"> <select name="dateien"> <TMPL_LOOP NAME=dateien> <option value="<TMPL_VAR _ >"><TMPL_VAR _ ></option> </TMPL_LOOP> </select> <input type="submit" value="Senden"> <TMPL_IF auswahl> <input type="text" name="data" value="<TMPL_VAR auswahl>"> </TMPL_IF> </form> </body> </html> OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |