Thread checkboxes mit Parametern zum Aufrufen desselben Skripts (12 answers)
Opened by miwieg at 2013-08-07 16:50

bianca
 2013-08-08 07:01
#169484 #169484
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
Suchst du soetwas?

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
use CGI;

my $cgih = CGI->new;

my $par1 = $cgih->param('par1');
my $par2 = $cgih->param('par2');

my $check1 = (defined $par1 && $par1 eq 'true' ? ' checked' : '');
my $check2 = (defined $par2 && $par2 eq 'true' ? ' checked' : '');
(my $script = $0) =~ s/^.*[\\\/]//g;

my $formular = <<HTML
<FORM action="$script">
    <INPUT TYPE="CHECKBOX" NAME="par1" VALUE="true"$check1> Parameter 1
    <INPUT TYPE="CHECKBOX" NAME="par2" VALUE="true"$check2> Parameter 2
    <INPUT TYPE="BUTTON" NAME="senden" VALUE="aktualisieren">
</FORM>
HTML
;

# Formular ausgeben
print $cgih->header.$formular;


Editiert von bianca: Korrekturen
Last edited: 2013-08-08 07:26:09 +0200 (CEST)
10 print "Hallo"
20 goto 10

View full thread checkboxes mit Parametern zum Aufrufen desselben Skripts