Thread Link nach Formulareingabe
(21 answers)
Opened by Drain at 2003-08-25 18:33
[quote=snadra,26.08.2003, 13:55]Nö, bei mir hat das bisher auch immer bestens geklappt, was für einen Browser hast Du denn, irgendwelche merkwürdigen Einstellungen?
Ein Timeout kommt aber eigentlich nur zustande wenn die Zielseite nicht erreichbar ist...[/quote] Benutze den IE5. Besondere Einstellungen liegen meines Wissens nach nicht vor. Hier nochmal das Skript: 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 #!/usr/bin/perl -w # Formular.pl sends a formated email with formular input (independend of number of fields) # 25.08.03 (spr) use strict; use CGI::Carp qw(fatalsToBrowser); # Input and formate read(STDIN, my $Daten, $ENV{'CONTENT_LENGTH'}); my @Formularfelder = split(/&/, $Daten); my ($Feld, $Name, $Wert); my %Formular; foreach $Feld (@Formularfelder) { (my $Name, my $Wert) = split(/=/, $Feld); $Wert =~ tr/+/ /; $Wert =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $Wert =~ s/</</g; $Wert =~ s/>/>/g; $Formular{$Name} = $Wert; } # Output # HTML-output my $test = 0; if( $test != 0) { # for testing print "Content-type: text/html\n\n"; print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "\n"; print "<html><head><title>CGI-Feedback</title></head>\n"; print "<body><h1>Resultate von <i>Formular.pl</i></h1>\n"; print "<b>Übertragene Daten:</b><br>"; while (($Name, $Wert) = each(%Formular)) { print "Das Formularfeld $Name besitzt den Wert $Wert.<br>\n"; } print "</body></html>\n"; } else { use CGI qw(redirect); print redirect("http://www.perl-community.de"); # print "Content-type: text/html\n\n"; # print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "\n"; # print "<html><head><title>$Formular{Formular}</title></head>\n"; # print "<body><h1>Danke für Ihre Anfrage</h1>\n"; # print # print "</body></html>\n"; } # Automatic Email sending my $Sendmail_Prog = 'sendmail.exe'; open (MAIL, "|$Sendmail_Prog -t") || die "Mailprogramm konnte nicht gestartet werden\n"; ...usw... Der Tip mit Quote funktioniert bei mir leider auch nicht. Es erscheint nur eine leere Seite mit [html] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY></BODY></HTML> [/html] als Inhalt. |