PHP表格给了一些错误 [英] PHP form giving some error

查看:76
本文介绍了PHP表格给了一些错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< html>
< body>

< form action ="welcome.php" method ="post">
名称:< input type ="text" name ="fname"/>
年龄:<输入type ="text" name ="age"/>
<输入type ="submit" name ="submit"/>
</form>

</body>
</html>







* welcome.php *
<?php
if(isset($ _ POST ["age"]))
{
echo"hi!".$ _ POST ["fname"].< br/&" ;;;
回声我们的年龄是".$ _ POST ["age"];
}
其他{

< html>
< body>

< form action ="welcome.php" method ="post">
名称:< input type ="text" name ="fname"/>
年龄:<输入type ="text" name ="age"/>
<输入type ="submit" name ="submit"/>
</form>

</body>
</html>
}
?>

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" name="submit" />
</form>

</body>
</html>







*welcome.php*
<?php
if(isset($_POST["age"]))
{
echo "hi !".$_POST["fname"]."<br/>";
echo "ur age is".$_POST["age"];
}
else{

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" name="submit" />
</form>

</body>
</html>
}
?>

推荐答案

_POST ["age"])))
{
回声嗨!".
_POST["age"]))
{
echo "hi !".


_POST ["fname"].< br/>";
回声我们的年龄是".
_POST["fname"]."<br/>";
echo "ur age is".


_POST ["age"];
}
其他{

< html>
< body>

< form action ="welcome.php" method ="post">
名称:< input type ="text" name ="fname"/>
年龄:<输入type ="text" name ="age"/>
<输入type ="submit" name ="submit"/>
</form>

</body>
</html>
}
?>
_POST["age"];
}
else{

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" name="submit" />
</form>

</body>
</html>
}
?>


这篇关于PHP表格给了一些错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆