Hola, soy bastante nuevo para secuencias de comandos CGI. Así que tomé algunas partes del código y formas hechas por correo electrónico.
Una de las obras!! Pero el segundo no funciona. del CGI es que por debajo de archivo en particular:
#!/usr/bin/perl
$sendmail_location = "/usr/sbin/sendmail";
read(STDIN, $formbuffer, $ENV{'CONTENT_LENGTH'});
@formpairs = split(/&/, $formbuffer);
foreach $formpair (@formpairs) {
($formname, $formvalue) = split(/=/, $formpair);
$formvalue =~ tr/+/ /;
$formvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex())/eg;
$formvalue =~ s/<([^>]|\n)*>//g;
if ($FORM{$formname}) { $FORM{$formname} = $FORM{$formname}.",".$formvalue; }
else { $FORM{$formname} = $formvalue; }
}
foreach $require (split(/\,/,$FORM{'require'})) {
if ($require eq "email" || $require eq "to") {
unless ($FORM{$require}=~ /\@/ && $FORM{$require}=~ /\./) {
$error .= "Error in $require.<BR>";
}
}
unless ($FORM{$require}) {
$error .= "Missing $require.<BR>";
}
}
unless ($FORM{'sendpage'}) {
$error .= "Missing confirmation page url<BR>";
}
if ($error) {
print "Content-type: text/html\n\n";
print qq(<CENTER><FONT COLOR="#000000"><B>Error</B><BR>-------------------------<BR>$error</FONT></CENTER>);
exit;
}
if ($FORM{'jounaam'}) {
$yeshow = qq(
Naam, $FORM{'jounaam'}
);
}
if ($FORM{'pakket'}) {
$yeshow = qq(
Pakket, $FORM{'pakket'}
);
}
if ($FORM{'email'}) {
$yeshow = qq(
E-mail, $FORM{'email'}
);
}
if ($FORM{'adres'}) {
$yeshow = qq(
Adres, $FORM{'adres'}
);
}
if ($FORM{'postcode'}) {
$yeshow = qq(
Postcode, $FORM{'postcode'}
);
}
if ($FORM{'plaats'}) {
$yeshow = qq(
Plaats, $FORM{'plaats'}
);
}
if ($FORM{'land'}) {
$yeshow = qq(
Land, $FORM{'land'}
);
}
if ($FORM{'telefoon'}) {
$yeshow = qq(
Telefoon, $FORM{'telefoon'}
);
}
if ($FORM{'gsm'}) {
$yeshow = qq(
gsm, $FORM{'gsm'}
);
}
if ($FORM{'message'}) {
$yeshow = qw(
From, $FORM{'message'}
);
}
if ($FORM{'hoekomjehier'}) {
$yeshow = qq(
Hoe kom je hier, $FORM{'hoekomjehier'}
);
}
open (MAIL, "|$sendmail_location -t") || die "Can't open $sendmail_location!\n";
print MAIL "From: $FORM{'jounaam'} <$FORM{'email'}>\n";
print MAIL "To: $FORM{'to'}\n";
print MAIL "Subject: $FORM{'subject'}\n\n";
print MAIL <<EOF;
$yeshow
$FORM{'message'}
EOF
close (MAIL);
print "Location: $FORM{'sendpage'}\n\n";
exit;
- #!/usr/bin/perl
- $sendmail_location = "/usr/sbin/sendmail";
- read(STDIN, $formbuffer, $ENV{'CONTENT_LENGTH'});
- @formpairs = split(/&/, $formbuffer);
- foreach $formpair (@formpairs) {
- ($formname, $formvalue) = split(/=/, $formpair);
- $formvalue =~ tr/+/ /;
- $formvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex())/eg;
- $formvalue =~ s/<([^>]|\n)*>//g;
- if ($FORM{$formname}) { $FORM{$formname} = $FORM{$formname}.",".$formvalue; }
- else { $FORM{$formname} = $formvalue; }
- }
- foreach $require (split(/\,/,$FORM{'require'})) {
- if ($require eq "email" || $require eq "to") {
- unless ($FORM{$require}=~ /\@/ && $FORM{$require}=~ /\./) {
- $error .= "Error in $require.<BR>";
- }
- }
- unless ($FORM{$require}) {
- $error .= "Missing $require.<BR>";
- }
- }
- unless ($FORM{'sendpage'}) {
- $error .= "Missing confirmation page url<BR>";
- }
- if ($error) {
- print "Content-type: text/html\n\n";
- print qq(<CENTER><FONT COLOR="#000000"><B>Error</B><BR>-------------------------<BR>$error</FONT></CENTER>);
- exit;
- }
- if ($FORM{'jounaam'}) {
- $yeshow = qq(
- Naam, $FORM{'jounaam'}
- );
- }
- if ($FORM{'pakket'}) {
- $yeshow = qq(
- Pakket, $FORM{'pakket'}
- );
- }
- if ($FORM{'email'}) {
- $yeshow = qq(
- E-mail, $FORM{'email'}
- );
- }
- if ($FORM{'adres'}) {
- $yeshow = qq(
- Adres, $FORM{'adres'}
- );
- }
- if ($FORM{'postcode'}) {
- $yeshow = qq(
- Postcode, $FORM{'postcode'}
- );
- }
- if ($FORM{'plaats'}) {
- $yeshow = qq(
- Plaats, $FORM{'plaats'}
- );
- }
- if ($FORM{'land'}) {
- $yeshow = qq(
- Land, $FORM{'land'}
- );
- }
- if ($FORM{'telefoon'}) {
- $yeshow = qq(
- Telefoon, $FORM{'telefoon'}
- );
- }
- if ($FORM{'gsm'}) {
- $yeshow = qq(
- gsm, $FORM{'gsm'}
- );
- }
- if ($FORM{'message'}) {
- $yeshow = qw(
- From, $FORM{'message'}
- );
- }
- if ($FORM{'hoekomjehier'}) {
- $yeshow = qq(
- Hoe kom je hier, $FORM{'hoekomjehier'}
- );
- }
- open (MAIL, "|$sendmail_location -t") || die "Can't open $sendmail_location!\n";
- print MAIL "From: $FORM{'jounaam'} <$FORM{'email'}>\n";
- print MAIL "To: $FORM{'to'}\n";
- print MAIL "Subject: $FORM{'subject'}\n\n";
- print MAIL <<EOF;
- $yeshow
- $FORM{'message'}
- EOF
- close (MAIL);
- print "Location: $FORM{'sendpage'}\n\n";
- exit;
Tal vez alguien puede encontrar el código equivocado. Me creo que la parte con:
if ($FORM{'jounaam'}) {
$yeshow = qq(
Naam, $FORM{'jounaam'}
);
}
if ($FORM{'pakket'}) {
$yeshow = qq(
Pakket, $FORM{'pakket'}
);
}
if ($FORM{'email'}) {
$yeshow = qq(
E-mail, $FORM{'email'}
);
}
if ($FORM{'adres'}) {
$yeshow = qq(
Adres, $FORM{'adres'}
);
}
if ($FORM{'postcode'}) {
$yeshow = qq(
Postcode, $FORM{'postcode'}
);
}
if ($FORM{'plaats'}) {
$yeshow = qq(
Plaats, $FORM{'plaats'}
);
}
if ($FORM{'land'}) {
$yeshow = qq(
Land, $FORM{'land'}
);
}
if ($FORM{'telefoon'}) {
$yeshow = qq(
Telefoon, $FORM{'telefoon'}
);
}
if ($FORM{'gsm'}) {
$yeshow = qq(
gsm, $FORM{'gsm'}
);
}
if ($FORM{'message'}) {
$yeshow = qw(
From, $FORM{'message'}
);
}
if ($FORM{'hoekomjehier'}) {
$yeshow = qq(
Hoe kom je hier, $FORM{'hoekomjehier'}
);
}
- if ($FORM{'jounaam'}) {
- $yeshow = qq(
- Naam, $FORM{'jounaam'}
- );
- }
- if ($FORM{'pakket'}) {
- $yeshow = qq(
- Pakket, $FORM{'pakket'}
- );
- }
- if ($FORM{'email'}) {
- $yeshow = qq(
- E-mail, $FORM{'email'}
- );
- }
- if ($FORM{'adres'}) {
- $yeshow = qq(
- Adres, $FORM{'adres'}
- );
- }
- if ($FORM{'postcode'}) {
- $yeshow = qq(
- Postcode, $FORM{'postcode'}
- );
- }
- if ($FORM{'plaats'}) {
- $yeshow = qq(
- Plaats, $FORM{'plaats'}
- );
- }
- if ($FORM{'land'}) {
- $yeshow = qq(
- Land, $FORM{'land'}
- );
- }
- if ($FORM{'telefoon'}) {
- $yeshow = qq(
- Telefoon, $FORM{'telefoon'}
- );
- }
- if ($FORM{'gsm'}) {
- $yeshow = qq(
- gsm, $FORM{'gsm'}
- );
- }
- if ($FORM{'message'}) {
- $yeshow = qw(
- From, $FORM{'message'}
- );
- }
- if ($FORM{'hoekomjehier'}) {
- $yeshow = qq(
- Hoe kom je hier, $FORM{'hoekomjehier'}
- );
- }
init es lo badass pero no tengo ni idea de que para fijar gif "alt =":(" title =" triste "/>
Si alguien puede ayudar a

Gracias de antemano