나는 PHP 메일 기능을 통해 클라이언트에게 html 전자 메일을 보내고 있습니다. & 기호가 굵게 표시되어 이메일 교체시 문제가 발생합니다! % 20 아래 (굵은 글씨)와 같은 내 ID 내의 문자와 비슷한.태그 값에 대한 html 전자 메일 문제
http://test.com/test-page.php?id=abcd**!**1234&cat_id=23
아래 코드는 제 코드입니다. $ to = '[email protected]';
// subject
$subject = 'test';
//message
$message.='<html><head><meta charset="UTF-8" /></head><body><p><a href="http://test.com/test-page.php?id=abcd1234&cat_id=23" target="_blank">Wine **&** Dine Offers</a></p></body></html>';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
// Additional headers
$headers .= 'To: test <[email protected]>' . "\r\n";
$headers .= 'From: test user <[email protected]>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
내가 메일을 보낸 후! % 20은 이메일의 문자와 비슷합니다. 이메일에 &을 제외하고 &을 시도했지만 아직 사용하지 않았습니다! 내 이메일 html 내에 추가.
동의하지만,이 매개 변수가 이중 인코딩 (PHP는 자동으로 $ _GET''의 매개 변수를 urldecodes 때문에)하고있을 것이다지고, 이에 클라이언트 측에서 문제가 필요한 경우 이 문제를 찾아 수정하는 것이 더 좋습니다 ... – DaveRandom
사용하지 않음? id = 83f428239f! % 20f3e338d02779a25e0bd641 & cat_id = 10 – jit