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
45
46
<html>
<head>
<title>
Test output
</title>
<style type="text/css">
body { margin:0; padding:0;}
div { border:1px solid #888; }
#login { width:512px; height:150px; position:absolute; top:0px; left:0px; }
#info { width:512px; height:150px; margin-left: 512px; }
#filter { width:200px; height:150px; margin-top: 0px; }
#toplist{ width:200px; height:468px; margin-top: 0px; }
#output { width:824px; height:618px; position:absolute; top:150px; left:200px; )
</style>
</head>
<body>
<div id="login">
<form action="/cgi-bin/cgi.pl" method="post">
<table border="0">
<colgroup><col width="150"></colgroup>
<tr>
<td align="right">Output window:</td>
<td><input name="value1" type="text" size="30" maxlength="100" value="output" /></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="Button" value="send">
</td>
</tr>
</table>
</form>
</div>
<div id="info">Info:</div>
<div id="filter">Filter:</div>
<div id="toplist">Toplist:</div>
<div id="output">Output:</div>
</body>
</html>
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
#!c:/xampp/perl/bin/perl.exe
use CGI qw(:all);
use strict;
use warnings;
my $cgi = new CGI;
my $css =<<EOCSS;
body { margin:0; padding:0;}
div { border:1px solid #888; }
output { width:824px; height:618px; position:absolute; top:150px; left:200px; }
EOCSS
my $window = $cgi->param('value1');
output($window);
exit;
#########################################################
#########################################################
sub output{
my $window = shift;
print $cgi->header;
print $cgi->start_html( -style=> {
-type=>'text/css',
-code=>$css,
}
);
print $cgi->h1( {-id=>'output'}, 'mein text');
print $cgi->end_html;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
~ # perl -MCGI
print CGI::start_html(-style=>{-code=>'a{color:red}'});
^D
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--/* <![CDATA[ *
a{color:red}
/* ]]> */-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
2011-10-29T11:27:13 topegDabei muss berücksichtigt werden, dass sowas auch bei deaktiviertem/nichtexistentem Javascript auf dem Client funktionieren muss.Also wenn du Teile einer Seite modifizieren willst, dann musst du immer die komplette Seite senden, oder Javascript nutzen.
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
45
46
47
48
49
50
<html>
<head>
<title>
Test output
</title>
<style type="text/css">
body { margin:0; padding:0;}
div { border:1px solid #888; }
#login { width:512px; height:150px; position:absolute; top:0px; left:0px; }
#info { width:512px; height:150px; margin-left: 512px; }
#filter { width:200px; height:150px; margin-top: 0px; }
#toplist{ width:200px; height:468px; margin-top: 0px; }
#output { width:824px; height:618px; position:absolute; top:150px; left:200px; )
</style>
</head>
<body>
<div id="login">
<form action="/cgi-bin/cgi.pl" method="post">
<table border="0">
<colgroup><col width="150"></colgroup>
<tr>
<td align="right">Text:</td>
<td><input name="value1" type="text" size="30" maxlength="100" value="output" /></td>
</tr>
<tr>
<td align="right">Output window:</td>
<td><input name="value2" type="text" size="30" maxlength="100" value="output" /></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="Button" value="send">
</td>
</tr>
</table>
</form>
</div>
<div id="info">Info:</div>
<div id="filter">Filter:</div>
<div id="toplist">Toplist:</div>
<div id="output">Output:</div>
</body>
</html>
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
45
46
47
48
49
50
51
#!c:/xampp/perl/bin/perl.exe
use CGI qw(:all);
use strict;
use warnings;
my $cgi = new CGI;
my $text = param ('value1');
my $windows = param ('value2');
output($cgi, $text, $windows);
exit;
#########################################################
#########################################################
sub output{
my $cgi = shift;
my $text = shift;
my $window = shift;
my $style = get_style();
print $cgi -> header;
print $cgi -> start_html(
-style => {-code => $style},
);
print $cgi -> div ( {-id => $window}, $text );
print $cgi -> end_html;
}
sub get_style {
my $style = <<"EOSTYLE";
body { margin:0; padding:0;}
div { border:1px;}
\#login { width:512px; height:150px; position:absolute; left:0px; top:0px; color:green; }
\#info { width:512px; height:150px; position:absolute; left:512px; top:0px; color:red; }
\#filter { width:200px; height:150px; position:absolute; left:0px; top:150px; color:black; }
\#toplist { width:200px; height:468px; position:absolute; left:0px; top:300px; color:magenta; }
\#output { width:824px; height:618px; position:absolute; left:150px; top:200px; color:blue; }
EOSTYLE
return $style;
}
#!c:/xampp/perl/bin/perl.exe -T
1 2 3 4 5 6 7 8
BEGIN { use Brain qw/intensive multiple/; } do think @security; slurp(*BOOKS); check(PROGRAM); die if not secure(); exit(HAVE_SOME_WORKSHOPS) if $self->too-naive();