php提交表单没反应

来源:百度知道 编辑:UC知道 时间:2024/06/15 20:29:22
<from action=input.php method=post>
姓名: <input type=text name="username"><br>
性别: <input type=text name="sex"><br>
<input type=submit>
</from>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>register_globals = ?</title>
</head>
<body>
<?php
echo "你填写的资料是: " . $_POST['username'] . ", " . $_POST['sex'];
?>
</body>
</html>
这两个连不上,可能是什么问题,我是新手,请高手指导。
都在一个文件夹里,看课件上面是这么写的程序,我也这么打出来了,一摸一样,就是输入完没反映
不需要加那个,是不是PHP出现问题拉。

表单标签不是<from>,而是<form> ,再有你测试时是在PHP环境中运行的吗?

你第二个文件名字是叫input.php么? 在不在一个文件夹

<from action="input.php" method="post">
难道是要加引号?

你的表单写的不对啊
<form>写成了<from>怎么可能对呢,呵呵,改下就好了

<form action='input.php' method='post'>
姓名:<input name='username' size=20 type='text'>
性别:<input name='sex' size=20 type='text'>
<input type="submit" name="submit">//传值是name来传递的。
</form>
<?php
if($_POST['submit']){
echo "你填写的资料是:".$_POST['username'].",".$_POST['sex'];
}
?>