Menu

Php Form Generator

Anonymous
2008-08-11
2013-06-03
  • Anonymous

    Anonymous - 2008-08-11

    Hello,

    I have a problem with the e-mail funktion, when I entered the dates after that i press submit the confirm.html pop up and in the bottom stands: Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\wwwroot\mitgleidsantrag2\processor.php on line 20 . I don't know how I can solve this problem may you can tell me?

    My processor.php:
    <?php

    $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

    session_start();
    if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
    mail("i have@chang it.com","phpFormGenerator - Form submission","Form data:

    Vorname: " . $_POST['field_1'] . "
    Nachname: " . $_POST['field_2'] . "
    Jahrgang: " . $_POST['field_3'] . "
    E-Mail: " . $_POST['field_4'] . "
    Können Sie schwimmen: " . $_POST['field_5'] . "
    Ansuchen als: " . $_POST['field_6'] . "
    Ansuchungsdatum: " . $_POST['field_7'] . "
    Kommentar: " . $_POST['field_8'] . "

    powered by phpFormGenerator.
    ");

    include("confirm.html");
    }
    else {
    echo "Invalid Captcha String.";
    }

    ?>

    Thanks a lot

    former

     
    • GrosBedo

      GrosBedo - 2008-08-11

      Hello,
      I am not a developper of this software (that I just found some minutes ago), but I'm a php programmer.
      It seems your processor.php hasn't properly configured the mail function.

      Here's the syntax:

      mail(your_mail, subject, message_body, headers)

      It seems you are missing the headers, so here's what I think you should have:

      <?php

      $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

      session_start();
      if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) { 
      mail("i have@chang it.com","phpFormGenerator - Form submission","Form data:

      Vorname: " . $_POST['field_1'] . " 
      Nachname: " . $_POST['field_2'] . " 
      Jahrgang: " . $_POST['field_3'] . " 
      E-Mail: " . $_POST['field_4'] . " 
      Können Sie schwimmen: " . $_POST['field_5'] . " 
      Ansuchen als: " . $_POST['field_6'] . " 
      Ansuchungsdatum: " . $_POST['field_7'] . " 
      Kommentar: " . $_POST['field_8'] . " 

      powered by phpFormGenerator.
      ", "From: some@mail.com\nReply-to: your@mail.com\nX-Mailer: PHP");

      include("confirm.html");
      }
      else {
      echo "Invalid Captcha String.";
      }

      ?>

      Hope it will fix your problem.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.