index.htmlの下部に記載しているformタグ(お問い合わせフォーム)です。さくらサーバーを使用しています。
<form action="mail.php" method="post" class="form-all" role="form"> <div class="form-group"> <label for="exampleInputName1">お名前</label> <input type="text" class="form-control" id="exampleInputName1" placeholder=" name" name="name" required> <label for="exampleInputEmail1">メール</label> <input type="email" class="form-control" id="exampleInputEmail1" placeholder=" email" name="email" required> <label for="exampleInputText1">内容</label> <textarea class="form-control" rows="3" name="message" required></textarea> </div> <button type="submit" value="SEND MESSAGE" class="btn btn-default">送信</button> </form>
これがindex.htmlです。
mail.phpは
<?php if($_server['request_method']=== 'post'){ $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; header('Location:thanks.html'); exit; } ?>
をmail.phpファイルで作っていますが、これで送信すればメールは届くのでしょうか?何かサーバー側で設定など必要なのでしょうか?
そして、mail.phpというように別ファイルではなくindex.htmlの1つのファイルないで完結はできなのでしょうか?できるけれどもしない方がよいのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。