Thank you, the page after the form does not show

How can I, after sending this mail via send_mail.php, get a page to go to another thank you page called tack.php in the same place in the structure as this mail.inc.php file?

<?php header("Content-Type: text/html; charset=utf8");
function mail_file($to, $from, $subject, $body, $file) {
    $boundary = md5(rand());
    $headers = array(
        'MIME-Version: 1.0',
        "Content-Type: multipart/mixed; charset=UTF-8; boundary=\"{$boundary}\"",
        "Content-Transfer-Encoding: 8bit", //Nytt 170711
        "From: {$from}"
    );
    $message = array(
        "--{$boundary}",
        //'Content-Type: text/HTML; charset=iso-8859-1', 170707
        'Content-Transfer-Encoding: quoted-printable', 
        '', 
        quoted_printable_encode($body), // Här är nya innehåll kodat som quoted-printable istället. 
        '',                             // Kommer orsaka en extra radbrytning efter meddelandet.
        "--{$boundary}",
        "Content-Type: {$file['type']}; name=\"{$file['name']}\"",
        "Content-Disposition: attachment; filename=\"{$file['name']}\"",
        "Content-Transfer-Encoding: base64", 
        '',
        chunk_split(base64_encode(file_get_contents($file['tmp_name']))),
        "--{$boundary}--",
        '',
    );
    mail($to, $subject, implode("\r\n", $message), implode("\r\n", $headers));
}
?>

      

+3


source to share


1 answer


Add a header to the end of your code:

header('Location: http://www.example.com/thank_you.php');

      

It will redirect the user to the specified page

EDIT:



Also remove your first header:

php header ("Content-Type: text/html; charset=utf8");

      

you don't need this as you shouldn't return anything

+3


source







All Articles