PHP 脚本甚至不运行。当我单击“提交”时,它只会刷新页面。我什至在没有对表单执行操作的情况下测试了代码,它也做了同样的事情。我尝试同时使用按钮和输入作为提交按钮。两者都不起作用。
这是表单代码:
<form name="input" action="oakmanagement.com/SendEmployeeApplication.php" method="post">
<table>
<tr>
<!-- middle -->
<td style="width: 12px">
<table cellpadding="0" cellspacing="0">
<!-- for multiple images use the rel=gallery[mygallery]
<tr>
<td><a href="http://www.expressionofjoy.com/outreach/images/sm/Event_0000s_0008_Layer-5.jpg" class="lightview" rel="gallery[mygallery]" title="my caption"><img src="/images/photoGalleryHolder.jpg" border="0" /></a></td>
</tr>
-->
<tr>
<td><img src="/images/spacer.gif" height="10px" /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><img src="/images/spacer.gif" height="10px" /></td>
</tr>
<tr>
<td><br /></td>
</tr>
</table>
</td>
<!-- spacing, do not touch -->
<td><img src="/images/spacer.gif" width="10px" /></td>
<!-- right -->
<td class="tdRightColumnTemplate">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="txtXLargeBlack">Oak Management Employment - SITE UNDER CONSTRUCTION!</td>
</tr>
<tr>
<td><img src="/images/spacer.gif" height="20px" /></td>
</tr>
<tr>
<td>
<!-- form -->
<table>
<tr>
<td><img src="/images/spacer.gif" height="20px" /></td>
</tr>
<!-- /A head + field -->
<!-- Personal header -->
<tr><td colspan="2" bgcolor="#cdd0bd">
<!-- <input type="Hidden" value="" name="PERSONAL_SECTION" /> -->
<b class="txtNormalBlack" style="padding-top: 10px; padding-bottom: 10px; padding-left: 10px;">Personal:</b>
</td></tr>
<!-- /A head + field -->
<!-- head + field -->
<tr><td colspan="2">
<table border="0" width="100%" cellspacing="1" cellpadding="1" align="left" style="background-color: #dddddd; height: 200px;">
<tr>
<td align="left" id="t_fname" class="formFields">First</td>
<td align="left" class="formFields">Middle</td>
<td align="left" id="t_lname" class="formFields">Last Name</td>
<td align="left" id="t_email" class="formFields">E-mail</td>
</tr>
<tr>
<td align="left" class="formFields"> <INPUT TYPE="text" NAME="FIRST_NAME" VALUE="" SIZE="15" MAXLENGTH="30">
</td><td align="left" class="formFields"> <INPUT TYPE="text" NAME="MIDDLE_NAME" VALUE="" SIZE="15" MAXLENGTH="30">
</td><td align="left" class="formFields"> <INPUT TYPE="text" NAME="LAST_NAME" VALUE="" SIZE="15" MAXLENGTH="30">
</td><td class="formFields"><INPUT TYPE="text" NAME="EMAIL" VALUE="" SIZE="20" MAXLENGTH="60"></td>
</tr>
<tr bgcolor="#cccccc">
<td class="formFields" align="center" colspan="2">
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="RESET" value="Reset" class="btnform" />
</td>
</tr>
</table>
</td></tr>
</table>
<!-- end of form -->
</td>
</tr>
<tr>
<td><img src="/images/spacer.gif" height="20px" /></td>
</tr>
</table>
</td>
</tr>
这是PHP:
function sendEmailToCompany() {
$from = stripslashes($_POST['EMAIL']);
$to = "mymail@mail.com";
$subject = "Employment Form For " . stripslashes($_POST['FIRST_NAME']);
$message = "Personal\n\nFirst Name: " . stripslashes($_POST['FIRST_NAME']) . "
\nMiddle Name: " . stripslashes($_POST["MIDDLE_NAME"]) . "
\nLast Name: " . stripslashes($_POST['LAST_NAME']) . "
\nE-mail: " . stripslashes($_POST['EMAIL']);
}
error_reporting(E_ERROR | E_PARSE);
sendEmailToCompany();
echo "<meta http-equiv='refresh' content='0;url=ThankYou.aspx'>";
?>