您好,我希望有人可以看看我的代码,并给我一个线索,了解可能导致这种情况的原因,因为它让我很难过。当我测试发送按钮时,一切都按承诺进行,我收到了发送的消息和重定向,但电子邮件显示所有字段,而我没有输入任何答案。这是表格:
<form action="contactformprocess.php" method="post" enctype="text/plain" name="form1" id="form1">
<p>
<label><span class="GoldText">What is your movie about?</span> What are you trying to tell us?<span id="What">
<textarea name="what" id="what" cols="45" rows="5"></textarea>
<span id="countWhat"> </span><span class="textareaRequiredMsg">Please Fill.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></label>
</p>
<p>
<label>Why is this Project Important to you? <span class="GoldText">What is it's purpose?</span><span id="why">
<textarea name="why" cols="45" rows="5" id="why"></textarea>
<span id="countwhy"> </span><span class="textareaRequiredMsg">Please Fill.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></label>
</p>
<p>
<label>What will people gain from watching it?<br />
<span class="GoldText">What sentiments are we left with?</span><span id="Contribution">
<textarea name="contribution" cols="45" rows="5" id="contribution"></textarea>
<span id="countContribution"> </span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></label>
</p>
<fieldset>
<legend>Where and when is it shot? (For dated events)</legend>
<p>
<label>Location:
<input type="text" name="location" id="location" />
</label>
</p>
<p>
<label>Date(s): <span id="EventDateStart">
<input name="eventdatestart" type="text" id="eventdatestart" />
<span class="textfieldInvalidFormatMsg">Invalid format.</span></span></label>
to<span id="EventDateEnd">
<label>
<input name="eventdateend" type="text" id="eventdateend" />
</label>
<span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </p>
<p>
<label>Time: <span id="EventTimeStart">
<input name="eventtimestart" type="text" id="eventtimestart" />
</span></label>
</p>
</fieldset>
<fieldset>
<legend>Please tell us who you are.</legend>
<p>
<label>Name </label>
<span id="ClientName">
<label>
<input type="text" name="clientname" id="clientname" />
</label>
<span class="textfieldRequiredMsg">Please Fill.</span></span></p>
<p>
<label>Phone
<input name="phone" type="text" id="phone" value="optional" />
</label>
</p>
<p>
<label>Email <span id="OnlineContact">
<input type="text" name="onlinecontact" id="onlinecontact" />
<span class="textfieldRequiredMsg">Please Fill.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></label>
</p>
<p>
<label>What other details help clarify your vision?<span id="FinalThoughts">
<textarea name="finalthoughts" cols="45" rows="5" id="finalthoughts"></textarea>
<span id="countFinalThoughts"> </span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></label>
</p>
<p>
<label>Send
<input name="button" type="submit" id="button" onclick="MM_validateForm('clientname','','R','phone','','NisNum','onlinecontact','','RisEmail','what','','R','why','','R');return document.MM_returnValue" value="Send" />
</label>
</p>
</fieldset>
</form>
这是php:
/* Email Variables */
$emailSubject = 'contactformprocess'; /*Make sure this matches the name of your file*/
$webMaster = 'wavelengthfredy@gmail.com';
/*design by Mark Leroy @ http://www.helpvid.net*/
/* Data Variables */
$what = $_REQUEST['what'];
$why = $_REQUEST['why'];
$contribution = $_REQUEST['contribution'];
$location = $_REQUEST['location'];
$eventdatestart = $_REQUEST['eventdatestart'];
$eventdateend = $_REQUEST['eventdateend'];
$eventtimestart = $_REQUEST['eventtimestart'];
$clientname = $_REQUEST['clientname'];
$phone = $_REQUEST['phone'];
$onlinecontact = $_REQUEST['onlinecontact'];
$finalthoughts = $_REQUEST['finalthoughts'];
$body = <<<EOD
<br><hr><br>
What: $what <br>
Why: $why <br>
Contribution: $contribution <br>
Location: $location <br>
EventDateStart: $eventdatestart <br>
EventDateEnd: $eventdateend <br>
EventTimeStart: $eventtimestart <br>
ClientName: $clientname <br>
Phone: $phone <br>
OnlineContact: $onlinecontact <br>
FinalThoughts: $finalthoughts <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
我查看了之前的一篇文章,发现大写是一个问题,所以我研究了一下,仍然遇到了这个问题。所有其他细节对我来说都很好......我将不胜感激。