anoniem Geplaatst: 4 november 2003 Delen Geplaatst: 4 november 2003 Hoi, ik heb een script gedownload en die wil ik gebruiken voor een formulier om mijn website. Toen ik het formulier wilde testen en op verzenden klikte kreeg ik een "software error" met de vermelding dat er iets niet goed 'ingesteld' was in het script. Weet iemand een oplossing, of misschien een beter script ? Quote Link naar reactie
anoniem Geplaatst: 4 november 2003 Auteur Delen Geplaatst: 4 november 2003 Wat meer gegevens over het huidige script en/of de foutmelding, etc. lijken me wel handig voor een zinvol antwoord.... :wink: Quote Link naar reactie
anoniem Geplaatst: 5 november 2003 Auteur Delen Geplaatst: 5 november 2003 Het gaat om de volgende foutmelding: --- Software error: Execution of fp.pl aborted due to compilation errors. --- En om de volgende file die in de cgi-bin staat: --- #!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); ##################################################### # # # NEW INNOVATION WEBSITE APPLICATIONS # # For installation manuals an visit the forum # # # ##################################################### ##### SCRIPT SETUP # Input your email address below. # Note: Leave a backslash "\" # in front of the @ sign! $E_Mail = "you\@yourweb.com"; # What is the location of your sendmail program? # If you aren't sure, contact your web host. $Mail_Program = "/usr/sbin/sendmail -t"; # If you aren't including an "email" field on the form(s) # to be processed, who should the emails appear "From"? $From_Address = "you\@yourweb.com"; # If you aren't including a "subject" field on the form(s) # to be processed, what should their subject be? $Subject = "Processed by NIWDA Form Processor."; # Do you wish to send an automated reply to user? If yes, # you will have to include the "email" field in your form(s). # If yes, insert the location of reply.txt below. # 1 = yes # 0 = no $Send_Reply = "1"; $Reply_Template = "reply.txt"; # What are the required fields? # Seperate with commas and inclose in single ticks '', @required = ('email','name','url','main'); # Where should users be redirected after a successful submit? $Return_Link = "http://www.niwda.com/demos/CGI/webmail"; # Do you wish to keep logs of all forms processed on your server? # If so, they will appear in the "submitted" directory. # 1 = yes # 0 = no $Log_Forms = "1"; print "Content-type: text/html\n\n"; if ( $ENV{'REQUEST_METHOD'} eq "POST" ) { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } @months = ("January","February","March","April","May","June","July", "August","September","October","November","December"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; $month = $mon + 101; $day = $mday + 100; $date = "$months[$mon] $mday, $year"; $time = "$hour\:$min\:$sec"; @fields = ('sername','name','url','password','address1','address2','city', 'zip','postal','country','email','phone','comments','state','province', 'likescript','contactyou','rateservice','liketocall','employed','officeaddress1','Officeaddress2','officetelno', 'mobileNo','timetocallYou','main'); foreach $req(@required) { if (! $FORM{$req}) { print qq~ (Required fields missing)<body bgcolor="#E2E2E2" link="#0000FF" vlink="#0000FF" alink="#0000FF" text="#000080" topmargin="0" leftmargin="0"> <div align="left"> <table border="1" width="51%" bordercolor="#E2E2E2" cellspacing="5"> <tr> <td width="100%" bgcolor="#E2E2E2" bordercolor="#000080"> <div align="center"> <table border="1" width="97%" bordercolor="#E2E2E2" bgcolor="#E2E2E2"> <tr> <td width="100%"> <p align="left"><font color="#FF0000">Error</font>! Please go <a href="javascript:history.go(-1);">back</a> and try again. Required fields are as follows</td> </tr> <tr> <td width="100%"> Name, Email, Url, Mail. You can require the whole fields if you wish.</td> </tr> </table> </div> </td> </tr> </table> </div> </body> ~; exit; } } if ($FORM{'email'}) { unless ($FORM{'email'} =~ /\w+@\w+.\w+/) { print qq~ Incorrect email format.<br><br> Please go <a href="javascript:history.go(-1);">back</a> and try again. ~; exit; } } open(MAIL,"|$Mail_Program") || & print MAIL "To: $E_Mail\n"; if (! $FORM{'email'}) { print MAIL "From: $From_Address\n"; } else { print MAIL "From: $FORM{'email'}\n"; } if (! $FORM{'subject'}) { print MAIL "Subject: $Subject\n\n"; } else { print MAIL "Subject: $FORM{'subject'}\n\n"; } print MAIL "Submitted at $time on $date...\n\n"; foreach $field(@fields) { if ($FORM{$field}) { if ($field eq "main") { $FORM{'main'} =~ s/\Q\n\E/\n/g; print MAIL "$field = $FORM{'main'}\n"; } else { print MAIL "$field = $FORM{$field}\n"; } } } close(MAIL); if ($Send_Reply eq "1") { open(REPLY,"$Reply_Template"); @reply = <REPLY>; close(REPLY); foreach $line(@reply) { $line =~ s/\Q\n\E/\n/g; $fiction .= $line; } open(MAIL,"|$Mail_Program") || & print MAIL "To: $FORM{'email'}\n"; print MAIL "From: $E_Mail\n"; print MAIL "$fiction\n\n"; print MAIL "---------------------------------\n"; print MAIL "Form Processor by NIWDA .\n"; print MAIL "http://www.niwda.com/\n"; print MAIL "---------------------------------\n"; close(MAIL); } if ($Log_Forms eq "1") { if ($FORM{'email'}) { open(LOG,">>submitted/$date.txt"); print LOG "Submitted at $time on $date...\n\n"; foreach $field(@fields) { if ($FORM{$field}) { if ($field eq "main") { $FORM{'main'} =~ s/\Q\n\E/\n/g; print LOG "$field = $FORM{'main'}\n"; } else { print LOG "<p>$field = $FORM{$field}\n"; } } } print LOG "\n"; print LOG "---------------------------\n\n"; close(LOG); } } print qq~ <HTML> <HEAD> <META HTTP-EQUIV=Refresh CONTENT=0;URL="$Return_Link"> </HEAD> <BODY></BODY> </HTML> ~; exit; sub noprogram { print qq~ Sendmail program failed to open!<br> Message NOT sent.<br> Please contact the webmaster about this problem. ~; exit; } --- En natuurlijk heb ik het e-mailadres e.d. wel aangepast voor mijn site. Ik hoop dat op deze manier iemand mij kan helpen. Nog wat belangrijke punten die de host stelt het script. Het moet zijn opgeslagen als .pl en onder UNIX codering (hoe dat moet weet ik niet, maar ik heb het gewoon met kladblok opgeslagen.) Verder heb ik de permissions goed ingesteld en geupload in ACSII mode. ik hoop dat iemand mij met deze gegevens wel kan helpen :wink: :lol: Quote Link naar reactie
anoniem Geplaatst: 5 november 2003 Auteur Delen Geplaatst: 5 november 2003 Sorry, maar ik ben er al uit. Ik was vergeten op het formulier zelf in te stellen dat het script in een bovenliggende map zat. Dus moesten er nog 2 puntjes voor :oops: Quote Link naar reactie
Aanbevolen berichten
Om een reactie te plaatsen, moet je eerst inloggen