
<?php
error_reporting(0);
foreach($_POST as $key=>$value) {
    $_POST[$key] = htmlspecialchars($value,ENT_QUOTES);
}

session_start();
if(!empty($_SESSION['input']) && $_SESSION['input'] === TRUE){
    unset($_SESSION['input']);
}else{
    $url = "./";
    header("Location: ".$url);
    exit;
}

// セッションの書き込み
session_start();
$_SESSION['page'] = TRUE;

?>

<!DOCTYPE html>
<html lang="ja">
   <head>
      <meta charset="UTF-8">
      <title></title>
      <meta name="viewport" content="width=device-width,user-scalable=yes">
      <meta name="format-detection" content="telephone=no">
      <meta name="description" content="">
      <meta property="og:title" content="">
      <meta property="og:description" content="">
      <meta property="og:image" content="img/ogp.png">
      <meta property="og:type" content="company">
      <meta property="og:locale" content="jp_JP">
      <meta property="og:site_name" content="">
      <meta property="og:url" content="">
      <meta name="twitter:title" content="">
      <meta name="twitter:description" content="">
      <meta name="twitter:image" content="img/ogp.png">
      <meta name="twitter:card" content="summary_large_image">
      <meta name="twitter:site" content="@">
      <meta name="twitter:url" content="">
      <meta name="msvalidate.01" content="7851330534A5BE0314CDBED4D717C563">
      <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./img/favicons/favicon.ico">
      <link rel="icon" type="image/vnd.microsoft.icon" href="./img/favicons/favicon.ico">
      <link rel="icon" href="./img/favicons/favicon.ico">
      <link rel="canonical" href="">
       <link rel="stylesheet" media="all" href="./css/style.css"/>
      <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&amp;family=Noto+Sans+JP:wght@100;300;400;500;700;900&amp;display=swap">
      <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&amp;display=swap">
      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link href="https://fonts.googleapis.com/css2?family=Kiwi+Maru&amp;family=Prompt:wght@100;700&amp;display=swap" rel="stylesheet">
      <link rel="stylesheet" href="https://use.typekit.net/bzf2hbl.css">
   </head>
   <body>
      <main>
          <link rel="stylesheet" href="./css/anews.css"/>
          <section class="confirm">
            <div class="confirm__contents">
               <div class="sec-top">
                  <h2 class="sec-ttl dark-blue">Contact</h2>
                  <p class="sec-sub">確認画面</p>
               </div>
                <form action="./thanks.php" method="post">
               <div class="confirm__contents__wrapper">
                  <div class="confirm__contents__wrapper-box">
                     <div class="confirm__contents__textarea font14">
                        <p class="confirm__contents__textarea-ttl">お名前</p>
                        <p class="confirm__contents__textarea-text"><?php echo $_POST['name'] ?></p>
                     </div>
                     <div class="confirm__contents__textarea font14">
                        <p class="confirm__contents__textarea-ttl">カタカナ</p>
                        <p class="confirm__contents__textarea-text"><?php echo $_POST['katakana'] ?></p>
                     </div>
                     <div class="confirm__contents__textarea font14">
                        <p class="confirm__contents__textarea-ttl">メールアドレス</p>
                        <p class="confirm__contents__textarea-text"><?php echo $_POST['email'] ?></p>
                     </div>
                     <div class="confirm__contents__textarea font14">
                        <p class="confirm__contents__textarea-ttl">電話番号</p>
                        <p class="confirm__contents__textarea-text"><?php echo $_POST['phone'] ?></p>
                     </div>

                     <div class="confirm__contents__textarea font14">
                        <p class="confirm__contents__textarea-ttl">備考欄</p>
                        <p class="confirm__contents__textarea-text"><?php echo $_POST['text'] ?></p>
                     </div>
                  </div>
                  <?php foreach($_POST as $key => $value){ ?>
                            <input type="hidden" name="<?php echo $key ?>" value="<?php echo $value ?>" />
                  <?php } ?>
                  <p class="reg-btn"><input class="reg-btn__text font18" type="submit" value="確定して送信する"></p>
                   <div class="prev">
                       <a href="javascript:history.back();" class="btn_a tsu">内容を修正する>></a>
                   </div>
               </div>
                </form>
            </div>
         </section>
      </main>
   </body>
</html>