이메일을 보낸 후 사용자를 리디렉션하고 싶습니다.
email()
-method (예 : header()
-method) 다음에 코드를 넣지 않으면 코드가 실행됩니다.
힌트가 있습니까?PHP 코드 내의 헤더 리디렉션이 작동하지 않습니다.
function process()
{
$msg = "Form Contents: \n\n";
foreach($this->fields as $key => $field)
$msg .= "$key : $field \n";
$to = '[email protected]';
$subject = 'thesubject';
$from = $this->fields['email'];
mail($to, $subject, $msg, "From: $from\r\nReply-To: $from\r\nReturn-Path: $from\r\n");
header('Location: thanks.html');
}
어떤 오류가 발생합니까? –
D : \ xampp \ php \ logs \ php_error_log의 D : \ xampp \ htdocs \ process_form.php에서 예상치 못한 'header'(T_STRING), 예상 함수 (T_FUNCTION) 구문 오류, PHP 구문 분석 오류가 발생했습니다. – spamup
전자 메일은 오류없이 전송됩니까? @mail (...)을 사용하면 어떨까요? – djot