Thread Browser Keep-alive (19 answers)
Opened by bianca at 2010-05-28 19:58

bianca
 2010-05-30 14:35
#137770 #137770
User since
2009-09-13
6991 Artikel
BenutzerIn

user image
Liest sich super und einfach.
Aber es paßt noch nicht ganz.

Meine Ausgabe:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
b0

<html>
<head>
</head>
<body>
<p> Bin DA!
<form action="test_keepalive.pl" method="post">
<input type="submit" value="Nochmal!">
</form>
</p>
</body>
</html>

0


Mein Script (Testfall 3!):
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/perl -W
use strict;
use warnings;
use IO::Handle;
STDOUT -> autoflush (1);        # sicherheitshalber statt $| = 1; gem. [msg://133383]
use CGI;
my $q = CGI -> new;
(my $script = $0) =~ s/^.*[\\\/]//g;
if (defined $q -> param ('action') && defined $q -> param ('sekunden')) {
        my $header = $q -> header;
        if ($q -> param ('action') eq 'start1') {
                sleep $q -> param ('sekunden');
        }
        elsif ($q -> param ('action') eq 'start3') {
                $q -> nph (1);  # no-parsed-header Modus (Header wird vom Script gesendet)
                sleep $q -> param ('sekunden');
                $header = "Status: 100 Continue\n$header";
        }
        else {
                print $header;
                for (my $z = 0; $z < $q -> param ('sekunden'); $z ++) {
                        print " \n";
                        sleep 1;
                }
                $header = '';
        }
        print <<HTML_TEIL;
$header
<html>
        <head>
        </head>
        <body>
                <p> Bin DA!
                        <form action="$script" method="post">
                                <input type="submit" value="Nochmal!">
                        </form>
                </p>
        </body>
</html>
HTML_TEIL
}
else {
        print $q -> header . <<HTML_TEIL;
<html>
        <head>
        </head>
        <body>
                <p>
                        <form action="$script" method="post">
                                <select name="action">
                                        <option value="start1">Test 1 (einfaches sleep)</option>
                                        <option value="start2">Test 2 (Schleife mit Blank pro Sekunde)</option>
                                        <option value="start3">Test 3 (mit eigenem Header)</option>
                                </select><br>
                                Anzahl Sekunden: <input type="text" name="sekunden"><br>
                                <input type="submit" value="Start">
                        </form>
                </p>
        </body>
</html>
HTML_TEIL
}


Was mache ich falsch?
Last edited: 2010-05-30 14:37:01 +0200 (CEST)
10 print "Hallo"
20 goto 10

View full thread Browser Keep-alive