OLD | NEW |
1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
2 | 2 |
3 print "Content-type: text/html\r\n"; | 3 print "Content-type: text/html\r\n"; |
4 | 4 |
5 @keypairs = split(/&/, $ENV{'QUERY_STRING'}); | 5 @keypairs = split(/&/, $ENV{'QUERY_STRING'}); |
6 | 6 |
7 $type = ""; | 7 $type = ""; |
8 | 8 |
9 foreach $pair (@keypairs) | 9 foreach $pair (@keypairs) |
10 { | 10 { |
11 ($name, $value) = split(/=/, $pair); | 11 ($name, $value) = split(/=/, $pair); |
12 | 12 |
13 if ($name eq "type") { | 13 if ($name eq "type") { |
14 $type = $value; | 14 $type = $value; |
15 } | 15 } |
16 } | 16 } |
17 | 17 |
18 print "Set-Cookie: reload-subframe-$type=1\r\n"; | 18 print "Set-Cookie: reload-subframe-$type=1\r\n"; |
19 print "\r\n"; | 19 print "\r\n"; |
20 | 20 |
21 print "<html>"; | 21 print "<html>"; |
22 print "<head>"; | 22 print "<head>"; |
23 print "</head>"; | 23 print "</head>"; |
24 | 24 |
25 @cookies = split(/;/, $ENV{'HTTP_COOKIE'}); | 25 @cookies = split(/;/, $ENV{'HTTP_COOKIE'}); |
26 | 26 |
27 $subframe_content = "Fail"; | 27 $subframe_content = "Fail"; |
28 | 28 |
29 foreach $pair (@cookies) | 29 foreach $pair (@cookies) |
30 { | 30 { |
31 ($name, $value) = split(/=/, $pair); | 31 ($name, $value) = split(/=/, $pair); |
32 | 32 |
33 $name =~ s/^\s+//; | 33 $name =~ s/^\s+//; |
34 $name =~ s/\s+$//; | 34 $name =~ s/\s+$//; |
35 | 35 |
36 if ($name eq "reload-subframe-$type") { | 36 if ($name eq "reload-subframe-$type") { |
37 $subframe_content = "Pass"; | 37 $subframe_content = "Pass"; |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 $src = "'reload-subframe-content.pl?text=$subframe_content'"; | 41 $src = "'reload-subframe-content.pl?text=$subframe_content'"; |
42 | 42 |
43 if ($type eq "iframe") { | 43 if ($type eq "iframe") { |
44 print "<body>"; | 44 print "<body>"; |
45 print "<iframe src=$src></iframe>"; | 45 print "<iframe src=$src></iframe>"; |
46 print "</body>"; | 46 print "</body>"; |
47 } elsif ($type eq "object") { | 47 } elsif ($type eq "object") { |
48 print "<body>"; | 48 print "<body>"; |
49 print "<object data=$src></object>"; | 49 print "<object data=$src></object>"; |
50 print "</body>"; | 50 print "</body>"; |
51 } else { | 51 } else { |
52 print "<frameset>"; | 52 print "<frameset>"; |
53 print "<frame src=$src>"; | 53 print "<frame src=$src>"; |
54 print "</frameset>"; | 54 print "</frameset>"; |
55 } | 55 } |
56 | 56 |
57 print "</html>"; | 57 print "</html>"; |
OLD | NEW |