Ergebnis 1 bis 3 von 3
  1. #1
    DarealZnarkde ist offline Tripel-As
    registriert
    24-09-2002
    Ort
    Bad Honnef, germany
    Beiträge
    186

    [Perl] Was stimmt hier nicht?

    Hey, ich hoffe das ist die richtige Area wo ich dieses Script poste: Eigentlich müsste alles funktionieren, aber irgendwie gibt es doch Fehler und ich habe keine Ahnung warum. Ich hoffe ihr könnt den Fehler finden...

    Code:
    #!/usr/bin/perl
    
    use strict;
    use CGI;
    my $cgi = new CGI;
    my %FORM = $cgi->Vars;
    my $check=0;
    
    print ("Content-type: text/html\n\n");
    
    open (LIST,"list.txt")|| die "The Free Thinkers page couldn't add your Email to the news mailing list. Please try it again.\n";
    for (<LIST>) {
      if (/$FORM{'email'}/) {
      $check=1;
      print "<font color=#FF0000>Your email was already in news list. To sign off use the links in your news mails.</font><br>";
      }
    }
    close (LIST);
    
    my @vorlage;
    
      if ($check==0) {
        open (LIST,">>list.txt")|| die "The Free Thinkers page couldn't add your Email to the news mailing list. Please try it again.\n";
        print LIST "$FORM{'email'}\n";
        close(LIST);
        #email schicken anfang
        
        open (VORLAGE,"templates/email_confirmation.html")|| die "The Free Thinkers page couldn't send you a confirmation.\n";
        my @vorlage=<VORLAGE>;
        close(VORLAGE);
        
        
        $mailprog = '/usr/sbin/sendmail';
    
        $recipient = $FORM{'email'};
    
    
    open (MAIL, "|$mailprog -t") || die "The Free Thinkers page couldn't send you a confirmation.\n";
    
    
    print MAIL "To: $recipient\n";
    
    # Reply-to can be set to the email address of the sender, assuming you
    # have actually defined a field in your form called 'email'.
    
    print MAIL "Reply-to: raoul\@znark\.de\n";
    
    # print out a subject line so you know it's from your form cgi.
    # The two \n\n's end the header section of the message.  anything
    # you print after this point will be part of the body of the mail.
    
    print MAIL "Subject: Mailing list confirmation\n\n";
    
    # here you're just printing out all the variables and values, just like
    # before in the previous script, only the output is to the mail message
    # rather than the followup HTML page.
    
    
    print MAIL "@vorlage";
    
    
    # when you finish writing to the mail message, be sure to close the
    # input stream so it actually gets mailed.
    
    close(MAIL);
    
    #email ende
    
    
    
    open (TMP, "templates/after_addemail.html")|| die "The Free Thinkers page couldn't open a template.\n";
    my @tmp=<TMP>;
    close (TMP);
    
    
    print "@tmp";
    "Was trinken Sie?" "Nichts." "Das ist ein großer Fehler!"

  2. #2
    Avatar von Albu
    Albu ist offline Foren-Gott
    registriert
    04-07-2001
    Beiträge
    13.501
    wie wäre es denn, wenn Du mal etwas konkreter wirst, als: "irgendwie gibt es noch Fehler"?? Also z.B. wann treten die auf, wie machen sie sich bemerkbar und was soll das Teil überhaupt genau machen? Wie soll man alle Fehler in einem Script finden, wenn man nicht genau weiß, was ein Feature und was ein Bug ist / sein könnte?
    1. Get people to play Space Taxi
    2. Sell real estates on neptun
    3. Profit!

    IE is not a browser, it is a scream.


    Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.

  3. #3
    DarealZnarkde ist offline Tripel-As
    registriert
    24-09-2002
    Ort
    Bad Honnef, germany
    Beiträge
    186
    OK, es gibt den Apache Server Standart Fehler. Meiner Meinung nach muss der Fehler hier drinne liegen:

    Code:
    $mailprog = '/usr/sbin/sendmail';
    
        $recipient = $FORM{'email'};
    
    
    open (MAIL, "|$mailprog -t") || die "The Free Thinkers page couldn't send you a confirmation.\n";
    
    
    print MAIL "To: $recipient\n";
    
    # Reply-to can be set to the email address of the sender, assuming you
    # have actually defined a field in your form called 'email'.
    
    print MAIL "Reply-to: raoul\@znark\.de\n";
    
    # print out a subject line so you know it's from your form cgi.
    # The two \n\n's end the header section of the message.  anything
    # you print after this point will be part of the body of the mail.
    
    print MAIL "Subject: Mailing list confirmation\n\n";
    
    # here you're just printing out all the variables and values, just like
    # before in the previous script, only the output is to the mail message
    # rather than the followup HTML page.
    
    
    print MAIL "@vorlage";
    
    
    # when you finish writing to the mail message, be sure to close the
    # input stream so it actually gets mailed.
    
    close(MAIL);
    
    #email ende
    "Was trinken Sie?" "Nichts." "Das ist ein großer Fehler!"

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •