1.php
include'form.html'
表单.html
<form action="email.php" method="post">
<input type="text" id="name" value="name" />
</form>
电子邮件.php
<?php
$name = $_POST['name'];
$email_message = "Name: $name ";
$sent = mail($email_to, $email_subject, $email_message);
if($sent) {
echo "success=yes";
} else {
echo "success=no";
}
include('success.html');
?>
错误:
Notice: Undefined index: name in C:\wamp\www\a\action.php on line 3
我还尝试在 form.html 中使它们成为全局变量,但不起作用