您好,欢迎访问一九零五行业门户网

php 表单数据的获取代码

<html> <head> <title>form</title> <meta http-equiv="content-type" content="text/html; charset=gb2312"> </head> <body> <form action="post.php" method="get" name="form1"> <table width="271" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="85"><div align="right">姓名:</div></td> <td width="186"><input name="username" type="text" id="username"></td> </tr> <tr> <td><div align="right">密码:</div></td> <td><input name="password" type="password" id="password"></td> </tr> <tr> <td><div align="right">密码确认:</div></td> <td><input name="password2" type="password" id="password2"></td> </tr> <tr> <td><div align="right">性别:</div></td> <td><select name="sex" id="sex"> <option value="0" selected>男</option> <option value="1">女</option> </select></td> </tr> <tr> <td><div align="right">生日:</div></td> <td><input name="birthday" type="text" id="birthday"></td> </tr> <tr> <td><div align="right">e-mail:</div></td> <td><input name="email" type="text" id="email"></td> </tr> <tr> <td><div align="right">职业:</div></td> <td><input name="job" type="text" id="job"></td> </tr> </table> <p align="center"> <input type="submit" value="submit"> <input type="reset" value="reset"> </p> </form> </body> </html>
<?php //本程序用于接收来自html页面的表单数据,并输出每个字段 echo "用户的输入如下所示:<br>"; echo "姓名:".$_get['username']."<br>"; echo "密码:".$_get['password']."<br>"; echo "密码确认:".$_get['password2']."<br>"; echo "性别:".$_get['sex']."<br>"; echo "生日:".$_get['birthday']."<br>"; echo "e-mail:".$_get['email']."<br>"; echo "职业:".$_get['job']."<br>"; ?>
<?php //本程序用于接收来自html页面的表单数据,并输出每个字段 echo "用户的输入如下所示:<br>"; echo "姓名:".$_post['username']."<br>"; echo "密码:".$_post['password']."<br>"; echo "密码确认:".$_post['password2']."<br>"; echo "性别:".$_post['sex']."<br>"; echo "生日:".$_post['birthday']."<br>"; echo "e-mail:".$_post['email']."<br>"; echo "职业:".$_post['job']."<br>"; ?>
更多php 表单数据的获取代码。
其它类似信息

推荐信息