感謝您回答我之前的查詢,但由於我不知道我錯過了什麼或者我錯在哪裏,所以我又被暫停了。下面是HTML表單我做:表單代碼和PHP
<div class="container">
<span class="reg"> <h1>Register Now</h1> </span>
<div class="row">
<div class="conent-part">
<div class="form-body">
<div class="fome-body">
<form id="form" action="/sendform.php" method="post">
<div class="row">
<div class="form-part">
<div class="form-group">
<input type="text" class="form-control" name="name" id="name" placeholder="Your Name">
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email Address">
</div>
<div class="form-group">
<input type="text" class="form-control" name="nname" id="nname" placeholder="Nominee's Name">
</div>
<div class="form-group">
<input type="email" class="form-control" name="nemail" id="nemail" placeholder="Nominee's Email">
</div>
</div>
<div class="form-part">
<div class="form-group">
<input type="text" class="form-control" name="nsport" id="nsport" placeholder="Nominee's Sport">
</div>
<div class="form-group">
<textarea class="form-control" rows="3" name="accomplishments" id="accomplishments" placeholder="Accomplishments"></textarea>
</div>
</div>
</div>
<div class="custom_btn">
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
這裏是我剛纔提出的sendform.php代碼,但它不會發布,它只是給sendform.php空白頁。
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$nname = $_POST['nname'];
$nemail = $_POST['nemail'];
$nsport = $_POST['nsport'];
$message = $_POST['accomplishments'];
$from = $from = $email;
$to = '[email protected]';
$subject = 'Athlete of the Week - Nomination';
$body = "From: $name\n Email: $email\n Nominee's Name: $nname\n Nominee's Email: $nemail\n Nominee's Nominee's Sport: $nsport\n Accomplishments:\n $accomplishments";
?>
<?php
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
echo '<p>Your Nomination has been Successfully Sent!</p>';
} else {
echo '<p>Oops! An error occurred. Try sending your Nomination again.</p>';
}
}
?>
你有錯誤/警告止跌回升? – 2014-10-19 09:55:00
@ DanielA.White不,沒有生成error.txt或任何錯誤。當我點擊Submit按鈕時,它會轉到/sendform.php,這只是一個空白頁面。 – 2014-10-19 09:57:24