perlunity.de - PERL | JAVASCRIPT | PHP | MySQL | APACHE



#!/COMMUNITY

Members: 5374
davon online: 1
weitere User: 24
Click for quality!




11.02.2012 / 21:15

Community-Member werden   |   Paßwort vergessen   |   OnlineMonitor (1) Wer ist online ... OnlineMonitor starten !
     

 

Home


PERLscripts


PHPscripts


JAVAscripts


Hilfreiches


Links2www


Newscenter


Community


Interna




Community  »  Perl: Allgemeines Forum zur Themenübersicht Themensuche Themenansicht in Thread-Modus


BeitragHallo HHIILLLFFFFFEEEEEE !!!!!! Premature end of script heade
Seitenanfang
Hallo HHIILLLFFFFFEEEEEE !!!!!!
Erst mal, glaube ich nicht das es an den "Text/plain" liegt oder an der Header.

Hier ist das Script. Es bekommt Daten aus einem html Formular. Die werden in einem Hash gespeichert, und jetzt bei der Auswertung, klappt es nicht.


#!/usr/local/bin/perl

use strict;
use CGI;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);

my %monHash;
my @Feldnamen = $cgi->param();

foreach my $feld(@Feldnamen) {
$monHash{$feld}=$cgi->param($feld);

}

if ($monHash{"radio2"}=="mode0"){
if($monHash{firmnr}==[1,2,3,4,5,6]){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Schk - Test";
print $cgi->end_html();

}
elsif($monHash{"firmnr"}==[7,8]){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Mrsb - Test";
print $cgi->end_html();
}
elsif($monHash{"firmnr"}==9){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Hck - Test";
print $cgi->end_html();
}

#mode Test




}
elsif($monHash{"radio2"}=="mode1"){ #mode Live
if($monHash{"firmnr"}==[1,2,3,4,5,6]){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Schlk - LIVE < br>";
print $cgi->end_html();
}
elsif($monHash{"firmnr"}==[7,8]){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Mrsb - LIVE < br>";
print $cgi->end_html();
}
elsif($monHash{"firmnr"}==9){
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print "Case Hck - LIVE < br>";
print $cgi->end_html();

}



}

else{
print $cgi->header();
print '<meta http-equiv="refresh" content="1; URL=http://yahoo.fr/">',"\n";
print $cgi->start_html('CGI-Feedback');
print "Keine Bedingung ist getroffen worden< br>";
print "Sie werden an der YAHOO Seite zurückgeleitet.< br>";
print $cgi->end_html();
}

Und hier ist das Formular


<form action="http://localhost/cgi-bin/redir.pl" method="post" target="">
<table >
<tr>
<td>Login name </td>
<td> <input type="" name="Login" value="" size=""> </td>
</tr>
<tr height="40">
<td>Plant </td>
<td> <select name="firmnr" size="" tabindex="50">

<option value="1">Sn</option>
<option value="2">Grg</option>

</select> </td>
</tr>
<tr height="40">
<td> </td>
<td>vid <input type="Radio" name="radio1" value="video " CHECKED>kas<input type="Radio" name="radio1" value="kassette"></td>
</tr>
<tr height="40">
<td>Mode :</td>
<td>Live<input type="Radio" name="radio2" value="mode1" CHECKED>Test<input type="Radio" name="radio2" value="mode0"></td>
</tr>
<tr>
<td> </td>
<td><input type="Submit" name="goNow" value="Send Now" lang="en" size=""> </td>
</tr>
</table>
</form>

Datum: 14.12.2006-11:10

Beitragre: Hallo HHIILLLFFFFFEEEEEE !!!!!! Premature end of script heade
Seitenanfang
Hallo,
auf den ersten Blick würd ich sagen, fehlen da
if($monHash{firmnr}==[1,2,3,4,5,6]){
gänsefüßchen if($monHash{"firmnr"}==[1,2,3,4,5,6]){

Weiter würde es heöfen was die log datei sagt wenn vorhanden:-)

gruß

Mick

Datum: 17.12.2006-16:58

-






-
-