サイトの PHP 連絡フォームを作成しました。サーバーでメーラーが有効になっているため、コードは実行されません。解析エラーは発生しません。吹き替えに関する提案や問題は何ですか?
//Check the form submission
if (isset($POST['submitted'])){
//validate the form
if(!empty($_POST['name']) &&
!empty($_POST['email']) &&
!empty($_POST['comments']) ){
//Create the body
$body = "Name:
{$_POST['name']}\n\nComments:
{$_POST['comments']}";
//Make the Name no longer than 70 Characters
$body = wordwrap($body, 70);
//Send the email
mail('xxx@xxxx.com',
'Contact Form Submission',$body,
"From: {$_POST['email']}");
//Print the Thank You message
echo'<p>Thank you for contacting us we appreciate your interest</p>';
//Clear $_POST so that its not a sticky form
$_POST = array();
} else {
echo'<p>Please fill out the form completely.</p>';
}
}// End of main isset ()IF
フォームコードは
<div id="wrapper">
<p>Please fill out this form to contact us.</p>
<form action="contact.php"method="post">
<p>Name: <input type="text" name="name"size="30"maxlength="60"value="<?php if(isset($_POST['name']))echo $_POST['name']; ?>" /></p>
<p>Email Address: <input type="text" name="email"size="30"maxlength="80"value="<?php if(isset($_POST['email']))echo $_POST['email']; ?>" /></p>
<p>Comments: <textarea name="comments"rows="5"cols="30"><?php if(isset($_POST['comments']))echo $_POST['comments']; ?></textarea></p>
<p><input type="submit" name="submit" value="Send" /> </p>
<input type="hidden" name="submitted" value="TRUE"/>
</form>
</div>