私は作成した連絡先フォームのHTML文書を持っているので、動作しません。PHP電子メールを送信しないフォーム。構文やサーバーがわからない場合
HTML::
<form class="form-horizontal" action="form_process.php" method="post" name="contact_form">
<div class="form-group">
<label class="col-sm-2 control-label white-color">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" placeholder="Email" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label white-color">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" placeholder="First Name" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label white-color">Message</label>
<div class="col-sm-10">
<textarea class="form-control" rows="5" placeholder="Type your message here!" name="message" required></textarea>
<button type="submit" class="btn btn-default btn-lg text-center" id="send-btn" name="submit">Send</button>
</div>
</div>
</form>
そして、ここではPHPです:
<?php
if (isset($POST['name']) && isset($_POST['email'])) {
$email = $_POST['email'];
$name = $_POST['name'];
$message = $_POST['message'];
$to = '[email protected]';
$subject = 'JorgeGoris.com Form Submission';
$text = "Name: ".$name."\n"."Email: ".$email."\n". "Wrote the following: "."\n\n".$message;
if(mail($to, $subject, $text, "From: ".$name)){
echo '<h1>Thanks! I will get back to you shortly.</h1>';
}
else {
echo 'Sorry there was an error! Please try again.';
}
}?>
これは、PHPのコンタクトフォームに取り組む初めてです私はそうのような別々のPHPファイルでPHPを持っています。すべてのファイルをサーバーにアップロードしましたが、サイコロはまだありません。あなたは何が間違って見える?
コードスニペットを掲載しながら、気をつけてください。電子メールIDのような機密情報は表示されません。 –
申し訳ありません。 – Jorge