我有点坚持开发联系表单,当我在线测试时,我得到500内部服务器错误。在我开发它之后我应该在我的ftp中做一些事情,除了将它复制到公共html文件夹?
或者是我的代码? (我提前道歉,我对这一切都不熟悉)
HTML
<tr>
<td><label for="Name">*Name:</label><br/>
<input name="Name" type="text" id="Name" size="40" maxlength="50" /></td>
</tr>
<tr>
<td><label for="Email">*Email:</label>
<br/>
<input name="Email" type="text" id="Email" size="40" maxlength="90" /></td>
</tr>
<tr>
<td><label for="Phone">Phone:</label><br/>
<input name="Phone" type="text" id="Phone" size="40" maxlength="15" /></td>
</tr>
<tr>
<td><label for="Department">*Select Your Department:</label><br />
<select name="Department" id="Department">
<option selected="selected">Select…</option>
<option value="dep1">Department 1</option>
<option value="dep2">Department 2</option>
<option value="dep3">Department 3</option>
<option value="dep4">Department 4</option>
<option value="dep5">Department 5</option>
<option value="dep6">Department 6</option>
<option value="dep7">Department 7</option>
</select></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><label for="Inquiry">*Any Inquiries / Feedback:</label><br />
<textarea name="Inquiry" id="Inquiry" cols="40" rows="15"></textarea></td>
</tr>
<tr>
<td><input type="reset" name="Reset" id="Reset" value="Reset" />
<input name="Submit" type="submit" id="Submit" onclick="YY_checkform('form1','Name','#q','0','Please Enter your Name','Email','#S','2','Email is Not Valid.','Phone','0_9','1','Phone is Not Valid.','Department','#q','1','Please Select a Department');return document.MM_returnValue" value="Send" />
* Required </td>
</tr>
</table>
</form>
PHP
$emailSubject = 'Inquiry/Feedback';
$emailselection = array("dep1"=>"department1@example.com.au","dep2"=>"department2@example.com.au","dep3"=>"department3@example.com.au","dep4"=>"department4@example.com.au","dep5"=>"department5@example.com.au","dep6"=>"odepartment6@example.com.au","dep7"=>"department7@example.com.au");
$to = $emails[$_POST["Department" ]];
$nameField = $_POST['Name'];
$emailField = $_POST['Email'];
$phoneField = $_POST['Phone'];
$departmentField = $_POST['Department'];
$inquiryField = $_POST['Inquiry'];
$body = <<<EOD
<br><hr><br>
Name: $Name <br>
Email: $Email <br>
Phone Number: $Phone <br>
Department: $Department<br>
Inquiry/Feedback: $Inquiry <br>
EOD;
$headers = "From: $Email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
$theResults = <<<EOD
<html>
<head>
<title>Form Submission</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>
<div>
<div align="left">Thank you!</div><a href="#">BACK</a>
</div>
</body>
</html>
EOD;
ECHO "$theResults";
?>