Last active
December 22, 2017 11:08
-
-
Save hrdtbs/4b76077cf8f168d7c7754e4073616326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getParams(){ | |
$return = array(); | |
if (isset($_GET) && is_array($_GET)) { | |
$return += $_GET; | |
} | |
if (isset($_POST) && is_array($_POST)) { | |
$return += $_POST; | |
} | |
return $return; | |
} | |
$params = getParams(); | |
$flag = false; | |
if (!empty($params)) { | |
$message = ""; | |
foreach ($params as $key => $value) { | |
$message .= $key.":".$value."<br>"; | |
} | |
mb_internal_encoding("UTF-8"); | |
$flag = mail( | |
[email protected], | |
mb_encode_mimeheader($params["title"], 'ISO-2022-JP-MS'), | |
mb_convert_encoding($message, 'ISO-2022-JP-MS'), //エンコードはISO-2022-JP-MSで行う! | |
"content-Type: text/html; charset=\"ISO-2022-JP\";\n" //ヘッダはISO-2022-JPを指定する! | |
); | |
} | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<?php | |
if($flag) { | |
?> | |
<p>再度送信してください</p> | |
<?php }else{?> | |
<p>送信ありがとうございました</p> | |
<?php | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment