Skip to main content

Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #270734
    giovannicrazy
    Participant

    I have a problem width sendmail.php and php mailer. When I push the button to send informations the page reload and remains on the same page and not redirect to the thank you page and the address of the page change from “www.website.com/page.php” to “www.website.com/page.php/sendmail.php”

    Here is the sendmail code:

    <?php
    
    if(isset($_POST['invia']))  {
    
        $nome = $_POST['nome'];
        $cognome = $_POST['cognome'];
        $telefono = $_POST['telefono'];
        $email = $_POST['email'];
        $sede = $_POST['sede'];
        $corso = $_POST['corso'];
        $corso_abbinato = $_POST['corso_abbinato'];
        $titolo_studio = $_POST['titolo_studio'];
        $messaggio = $_POST['messaggio'];    
    
        require '/phpmailer/PHPMailerAutoload.php';
    
        $mail = new PHPMailer;
    
    
        $mail->setLanguage('it', '/phpmailer/language/');
    
    
        $mail->From = '[email protected]';
        $mail->FromName = 'Scuola Internazionale di Comics';
        $mail->addAddress('[email protected]', '[TOO]');     // Add a recipient
    
        $mail->isHTML(true);                                  // Set email format to HTML
    
        $mail->Subject = 'Contatti';
        $mail->Body    = 'Nome: ' . $nome . '<br> Cognome: ' . $cognome . '<br /> Email: ' . $email . '<br /> Telefono: ' . $telefono . '<br>Sede:' . $sede . '<br>Corso:' . $corso . '<br> Corso Abbinato:' . $corso_abbinato . '<br>Titolo di studio:' . $titolo_studio . '<br>Messaggio:' . $messaggio;
    
        $mail2 = new PHPMailer;
    
        $mail2->setLanguage('it', '/phpmailer/language/');
    
    
        $mail2->From = '[email protected]';
        $mail2->FromName = 'Scuola Internazionale di Comics';
        // $mail2->addAddress($email);     // Add a recipient
    
        // $mail2->isHTML(true);                                  // Set email format to HTML
    
        // $mail2->Subject = 'Richiesta Informazioni';
        // $mail2->Body    =   'html text';
    
    
        if(!$mail->send()) {
            $cod_errore = $mail->ErrorInfo;
            header("Location: /thank.html");
        } else if(!$mail2->send())  {
            $cod_errore = $mail2->ErrorInfo;
            header("Location: /thank.html");
        } else {
            header("Location: /thank.html");
        }
    
    }
    
    ?>
    
    
    #270739
    Pogany
    Participant

    Just asking: do you have a headers_senterror?

    #270740
    giovannicrazy
    Participant

    No

    #270741
    giovannicrazy
    Participant

    Just reload the page and I do not receive any mail and the page reload to the same one

    #270993
    Anonymous
    Inactive

    You have posted your php but your problem might be in your html. You say the problem is the redirect but is the rest of the form actually working?

    Take a look at the form action attribute in your HTML. Are you confident that is correct?

    #271198
    giovannicrazy
    Participant

    Too late, I solved the issue. Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.