我无法从此电子邮件表单中获取 POST 变量。
有什么建议么?
html文件中的表单部分:
<form id="form_28" name="register" onsubmit="return validate_form_28(this)" action="sendmail.php" method="post" target="_blank" enctype="text/plain" style="margin:0;position:absolute;left:67px;top:297px;width:576px;height:291px;">
<input type="text" id="edit_23" name="email" value="" style="position:absolute; left:290px; top:93px; width:209px;">
</form>
sendmail.php 文件
<?php
$email = $_POST['email'] ;
$email_body = "Here is the message";
mail( "mymail@mysite.com", "title", $email_body, "From: $email" );
print "Congratulations your email has been sent";
?>
validate_form_28 :
function validate_form_28( form )
{
if( ltrim(rtrim(form.elements['email'].value,' '),' ')=="" ) { alert("you have to fill it"); form.elements['email'].focus(); return false; }
if(!ValidateEmail(form.elements['email'].value)) { alert("not valid emailv"); form.elements['email'].focus(); return false; }
return true;
}