如何通过PHP的GET方法实现表单数据提交演示?
- 内容介绍
- 文章标签
- 相关推荐
本文共计104个文字,预计阅读时间需要1分钟。
PHP通过GET方式提交表单示例,$_PHP_SELF表示当前页面,PHP中通过$_GET变量获取用户提交的信息?phpif ($_GET[name] || $_GET[age]) { echo Welcome . $_GET[name] . ; echo You are . $_GET[age] . years old;}
php通过GET方式提交表单演示,$_PHP_SELF表示当前页面,php中通过$_GET变量获得用户提交的信息
<?php if( $_GET["name"] || $_GET["age"] ) { echo "Welcome ". $_GET['name']. "<br />"; echo "You are ". $_GET['age']. " years old."; exit(); } ?> <html> <body> <form action="<?php $_PHP_SELF ?>" method="GET"> Name: <input type="text" name="name" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html>
本文共计104个文字,预计阅读时间需要1分钟。
PHP通过GET方式提交表单示例,$_PHP_SELF表示当前页面,PHP中通过$_GET变量获取用户提交的信息?phpif ($_GET[name] || $_GET[age]) { echo Welcome . $_GET[name] . ; echo You are . $_GET[age] . years old;}
php通过GET方式提交表单演示,$_PHP_SELF表示当前页面,php中通过$_GET变量获得用户提交的信息
<?php if( $_GET["name"] || $_GET["age"] ) { echo "Welcome ". $_GET['name']. "<br />"; echo "You are ". $_GET['age']. " years old."; exit(); } ?> <html> <body> <form action="<?php $_PHP_SELF ?>" method="GET"> Name: <input type="text" name="name" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html>

