我試圖爲一個網站設置一個簡單的PHP聯繫表格,我需要一些幫助修改PHP以列出選擇菜單中的多個項目,並希望得到幫助。我是一名平面設計師,而不是開發人員,所以很多都是我的頭腦。這就是問題所在區域位置:PHP電子郵件表格多重選擇
<label for="Events[]">Which Event(s) Will You Be Attending?</label>
<div class="input-bg">
<select name="Events[]" size="6" multiple="MULTIPLE" class="required" id="Events[]">
<option value="Wednesday">Portfolio Show June 16</option>
<option value="Thursday">Portfolio Show June 17</option>
<option value="Saturday">Graduation Ceremony</option>
<option value="Saturday Eve">Graduation Party</option>
<option value="Not Sure">Not Sure</option>
<option value="Not Coming">Not Coming</option>
</select>
</div>
而這裏的PHP:
<?php
// CHANGE THE VARIABLES BELOW
$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "Graduation RSVP";
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Guests = Trim(stripslashes($_POST['Guests']));
$Events = Trim(stripslashes($_POST['Events']));
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Guests: ";
$Body .= $Guests;
$Body .= "\n";
$Body .= "Events: ";
$Body .= $Events;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
// CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://justgooddesign.net/graduation/error.html\">";
}
?>
任何幫助真的表示讚賞!
謝謝,這有很大的幫助!這些東西大部分都在我頭上。 – Justin 2010-06-05 20:18:51
我們都從某個地方開始,只是很樂意幫助:-) – 2010-06-05 21:10:38