AWSのcloud9でhtmlで入力フォームと確認画面を作成したのですがプレビューで入力内容が反映されませんので解決をお願い致します。
index.htmlファイル
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>お問い合わせフォーム</title> <script type="text/javascript" src="contact.js"></script> </head> <body> <div> <form action="index2.html" method="post"> <h1 class="contact-title">お問い合わせ 内容入力</h1> <p>お問い合わせ内容をご入力の上、「確認画面へ」ボタンをクリックしてください。</p> <div> <div> <label>お名前<span>必須</span></label> <input type="text" name="name" placeholder="例)山田太郎" value=""> </div> <div> <label>ふりがな<span>必須</span></label> <input type="text" name="furigana" placeholder="例)やまだたろう" value=""> </div> <div> <label>メールアドレス<span>必須</span></label> <input type="text" name="email" placeholder="例)guest@example.com" value=""> </div> <div> <label>性別<span>必須</span></label> <input type="radio" name="sex" value="男性" checked> 男性 <input type="radio" name="sex" value="女性"> 女性 </div> <div> <label>問題?<span>必須</span></label> <textarea name="question" rows="5" placeholder="例)私の好きな色は何色でしょうか?"></textarea> </div> <div> <label>答え<span>必須</span></label> <input type="text" name="answer" placeholder="例)黄色" value=""> </div> <form> <label>ギフト<span>必須</span></label> <input type="file" name="image" required> </form> </div> <button type="submit"><a href="index2.html">確認画面へ</a></button> </form> </div> </body> </html>index2.html
<html lang="ja"> <head> <meta charset="UTF-8"> <title>お問い合わせフォーム</title> <script type="text/javascript" src="contact.js"></script> </head> <body> <div> <form action="index.html" method="post"> <input type="hidden" name="name" value="<?php echo $name; ?>"> <input type="hidden" name="furigana" value="<?php echo $furigana; ?>"> <input type="hidden" name="email" value="<?php echo $email; ?>"> <input type="hidden" name="sex" value="<?php echo $sex; ?>"> <input type="hidden" name="question" value="<?php echo $question; ?>"> <input type="hidden" name="answer" value="<?php echo $answer; ?>"> <input type="hidden" name="image" value="<?php echo $image; ?>"> <h1 class="contact-title">お問い合わせ 内容確認</h1> <p>お問い合わせ内容はこちらで宜しいでしょうか?<br>よろしければ「送信する」ボタンを押して下さい。</p> <div> <div> <label>お名前</label> <p><?php echo $_POST['name']; ?></p> </div> <div> <label>ふりがな</label> <p><?php echo $furigana; ?></p> </div> <div> <label>メールアドレス</label> <p><?php echo $email; ?></p> </div> <div> <label>性別</label> <p><?php echo $sex ?></p> </div> <div> <label>問題</label> <p><?php echo $question; ?></p> </div> <div> <label>答え</label> <p><?php echo $answer); ?></p> </div> <div> <label>ギフト</label> <p><?php echo $image; ?></p> </div> </div> <input type="button" value="内容を修正する" onclick="history.back(-1)"> <button type="submit" name="submit"><a href="index3.html">送信する</a></button> </form> </div> </body> </html>あなたの回答
tips
プレビュー