【发布时间】:2013-09-19 12:12:36
【问题描述】:
更新:没有任何 php 文件正在运行。有没有办法解决这个问题?
我有一个包含电子邮件详细信息的页面:
<form method="POST" sourceindex="44" action="semail.php" name="form1" onSubmit="return validate_form ( );">
<p>
<label>Your name:<br>
<input sourceindex="47" name="mail_name" class="text_field" type="text">
</label>
</p>
<p>
<label>Your e-mail:<br>
<input sourceindex="51" name="mail_email"
class="text_field" type="text">
</label>
</p>
<p>
<label>Message:<br>
<textarea sourceindex="55" name="mail_msg" cols="45"
rows="5" class="text_area"></textarea>
</label>
</p>
<input name="B1" type="submit" class="form_button" value="" />
</form>
这里是php代码(全部在semail.php中):
<?php
$mail_to ="someEmail@hotmail.com";
$mail_subject = "Message From a Customer";
$mail_body ="Name of the Coustomer: ".$_POST['mail_name']."\n";
$mail_body .= "E-Mail Of the Coustomer: ".$_POST['mail_email']."\n";
$mail_body .= "The Message: ".$_POST['mail_msg']."\n";
if(mail($mail_to, $mail_subject, $mail_body))
echo "Thanks for your Message";
else
echo "Failed to send the e-mail"
?>
每当我点击发送 semail.php 页面时都会显示此错误:未指定输入文件 有人可以帮我找出问题所在吗?
【问题讨论】:
-
你能加一个吗?在 echo "Failed to send the e-mail" 结尾,看看是否有效
-
可能是重复的? stackoverflow.com/questions/14555996/no-input-file-specified> 即使编码不同,问题也是一样的。
-
Satya:已经在那里了。 mathielo:我试过了,但没用。任何其他建议可能是什么错误?
-
@Satya,在关闭
?>之前的最后一条指令不需要;。分号的实际使用是为了区分不同的指令,所以如果你没有更多的指令并关闭php的标签,你不会有问题。不过,我更喜欢始终使用它们,即使是简短的指令,例如<?php echo "Something!"; ?>。 -
表单中的发送邮件按钮在哪里?验证 semail.php 的路径是否正确