表单提交后,没有页面跳转
我写了a.html和a.php,两者放在php运行环境同一目录下,a.html为提交一个表单,a.php为接受表单数据并反馈,可是我从浏览器打开a.html并提交表单后,...
我写了a.html和a.php,两者放在php运行环境同一目录下,a.html为提交一个表单,a.php为接受表单数据并反馈,可是我从浏览器打开a.html并提交表单后,并没有反馈发生,这是为什么,求教大家。
a.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>feedback</title>
</head>
<body>
<div><p>Please input your information to submit the feedback</p>
<form action="newfile.php" method="POST">
<p>Name: <select name="title">
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Ms.">Ms.</option>
</select>
<input type="text" name="name" size="20" /></p>
</form>
</div>
</body>
</html>
a.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title> welcome to the web! </title>
</head>
<body>
<?php
$title=$_POST['title'];
$name=$_POST['name'];
print "<p>Thank you,$title $name for your comments.</p>“;
?>
</body>
</html> 展开
a.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>feedback</title>
</head>
<body>
<div><p>Please input your information to submit the feedback</p>
<form action="newfile.php" method="POST">
<p>Name: <select name="title">
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Ms.">Ms.</option>
</select>
<input type="text" name="name" size="20" /></p>
</form>
</div>
</body>
</html>
a.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title> welcome to the web! </title>
</head>
<body>
<?php
$title=$_POST['title'];
$name=$_POST['name'];
print "<p>Thank you,$title $name for your comments.</p>“;
?>
</body>
</html> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询