Thread Ausgabe in vordefinierte Stylesheet Bereiche (14 answers)
Opened by a_abels at 2011-10-28 15:37

a_abels
 2011-10-28 15:37
#153640 #153640
User since
2010-07-11
90 Artikel
BenutzerIn
[default_avatar]
Hallo zusammen,

ich habe in meinem HTML-Skript mehrere Stylesheet Bereiche definiert und möchte nun die Ausgabe eines CGI Skriptes in einem dieser Bereiche stattfinden lassen. Leider öffnet sich bei mir immer ein neues Fenster und es wird kein angesprochener Stylesheet-Bereich benutzt.
Ziel wäre es, über das Formular einen Bereiche abzufragen, in dem die Ausgabe des CGI Skriptes stattfinden soll.

Hier mal mein HTML-Skriptcode:
Code: (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
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>


und hier das CGI Skript:
Code: (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
#!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;

}


Gern würde ich natürlich die bereits definierten Bereiche aus dem HTML-Dokument nutzen (und nicht noch einmal im CGI Skript definieren), aber die Suche in diesem Forum hat mir den Hinweis auf das Definieren der $css Variablen gegeben. Dennoch läuft es nicht.

Vielleicht kann mir jemand einen Hinweis geben. Danke vorab.

mfg André

View full thread Ausgabe in vordefinierte Stylesheet Bereiche