PHPmailer를 사용하여 문제를 발견했습니다. 표시된 위치에서 100 % 작동하는 헤더 기능에 대한 지원 기능 리디렉션이 있습니다. 그것은 그것이 작동하고 싶습니다 의견에 표시된 위치에서 작동하지 않습니다. 다른 모든 기능은 리디렉션 기능의 위치와 상관없이 완벽하게 작동합니다. 어떤 아이디어? 이것은 또한 내가 찾지 못했던 해결책이 이미 있다면 사전에 사과하는 첫 번째 게시물이기도합니다.PHP 메일러 리디렉션 문제
<?php
if(isset($_POST['replyall'])) {
redirect("index.php?leadreply"); // Why does this have to be here to work???? //
if(isset($_POST['chk1'])) {
$email = new PHPMailer();
$email->From = $_POST['author'];
$email->FromName = 'JGM Decorating';
$email->Subject = 'Reply to your contact request';
$email->Body = $_POST['comments'];
$email->AddAddress($_POST['destination']);
$file_to_attach = '../crm/gtcjgm.pdf';
$email->AddAttachment($file_to_attach , 'Terms and Conditions.pdf');
return $email->Send();
// I would like to have the redirect here but it doesn't work??//
} else {
$email = new PHPMailer();
$email->From = $_POST['author'];
$email->FromName = 'JGM Decorating';
$email->Subject = 'Reply to your contact request';
$email->Body = $_POST['comments'];
$email->AddAddress($_POST['destination']);
$file_to_attach = '';
$email->AddAttachment($file_to_attach , 'Terms and Conditions.pdf');
return $email->Send();
// I would like to have a different redirect here but it doesn't work??//
}
}
?>
'리디렉션'을 호출하기 전에 '반환'하기 때문입니다. – tkausl
이것이 실제 코드라면 ___returning to___이라고 생각합니까? 함수가 아니기 때문에 반환하지 않습니다. – RiggsFolly
이것은 메일 첨부와 관련된 다른 대답에서 취한 작동 코드입니다. 나는 너의 조언을 듣고'반환'을 지웠다. 내가 원했던대로 정확하게 작동합니다. @ RiggsFolly !!! – Greg