- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
May 7, 2018 at 9:24 am #270734giovannicrazyParticipant
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"); } } ?>
May 7, 2018 at 10:55 am #270739PoganyParticipantJust asking: do you have a
headers_sent
error?May 7, 2018 at 10:57 am #270740giovannicrazyParticipantNo
May 7, 2018 at 10:59 am #270741giovannicrazyParticipantJust reload the page and I do not receive any mail and the page reload to the same one
May 13, 2018 at 3:42 am #270993AnonymousInactiveYou 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?
May 16, 2018 at 10:38 am #271198giovannicrazyParticipantToo late, I solved the issue. Thanks
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘Back End’ is closed to new topics and replies.