print \"content-type: text/html\\n\\n\"; print \"<HTML><HEAD><TITLE>Tak for din interesse</TITLE></HEAD>\"; print \"<body bgcolor=\"#000000\" text=\"#FFFFFF\">\"; print \"Du bliver nu mailet når Dyrk.dk er på fødderne, tak for din interesse :)\"; print \"</BODY>\"; print \"</HTML>\";
navnet på e-mail formen er \"email\" og i kan tjekke den på www.dyrk.dk/test.htm
open (emails,\">>email.txt\"); print lagerfil \"$FORM{`email´} ;\" close (lagerfil) ;
dur ikke!
open (EMAILS,\">>email.txt\") || die(\'Could not open file for appending\\n\\n\'); print EMAILS \"$FORM{`email´} ;\" close (EMAILS) || die(\'Could not close file\');
read(STDIN, $buffer, $ENV{`CONTENT_LENGTH´}) ; @pairs = split (/&/, $buffer) ; foreach $pair (@pairs) { ($name, $value) = split(/=/, $pairs) ; $value =~ tr/+/ /; $value =~ s/%([a-fA-f0-9] [a-fA-f0-9])/pack(\"C\", hex($1))/eg; $FORM{$name} = $value; open (EMAILS,\">>email.txt\") || die(\'Could not open file for appending\\n\\n\'); print EMAILS \"$FORM{`email´} ;\" close (EMAILS) || die(\'Could not close file\');
print \"content-type: text/html\\n\\n\"; print \"<HTML><HEAD><TITLE>Tak for din interesse</TITLE></HEAD>\" ; print \"<body bgcolor=\"#000000\" text=\"#FFFFFF\">\" ; print \"Du bliver nu mailet når Dyrk.dk er på fødderne, tak for din interesse :)\"; print \"</BODY>\" ; print \"</HTML>\" ;
men jeg får stadig disse fejl: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 8, near \"print\" syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 14, near \"print\" Missing right curly or square bracket at D:\\dyrk.dk\\cgi-bin\\email.pl line 18, within string Execution of D:\\dyrk.dk\\cgi-bin\\email.pl aborted due to compilation errors.
Husk på, at når du bruger \" i en linie hvor der allerede er \" (fx. ved print), så skal du escape det! Altså skal linien med <body ...> rettes til: print \"<body bgcolor=\\\"#000000\\\" text=\\\"#FFFFFF\\\">\";
prøv at ændre open (EMAILS,\">>email.txt\") || die(\'Could not open file for appending\\n\\n\'); til open (EMAILS,\"+<email.txt\") || die(\'Could not open file for appending\\n\\n\'); måske hjælper det... kan ikke lige lure hvorfor den ellers ikke opdaterer.
jeg får denne fjel hvis jeg prøver: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 10, near \"$FORM{´email´\" syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 12, near \"}\" Execution of D:\\dyrk.dk\\cgi-bin\\email.pl aborted due to compilation errors.
nej, forkert...denne fejl: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 10, near \"$FORM{\" syntax error at D:\\dyrk.dk\\cgi-bin\\email.pl line 12, near \"}\" Execution of D:\\dyrk.dk\\cgi-bin\\email.pl aborted due to compilation errors.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.