php 表单数据的获取代码

前端之家收集整理的这篇文章主要介绍了php 表单数据的获取代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="2213" class="copybut" id="copybut2213" onclick="doCopy('code2213')"> 代码如下:

<div class="codebody" id="code2213">


Form
<Meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<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">姓名:
</td>
<td width="186"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td><div align="right">密码:
</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td><div align="right">密码确认:
</td>
<td><input name="password2" type="password" id="password2"></td>
</tr>
<tr>
<td><div align="right">性别:
</td>
<td><select name="sex" id="sex">

<option value="1">女
</td>
</tr>
<tr>
<td><div align="right">生日:
</td>
<td><input name="birthday" type="text" id="birthday"></td>
</tr>
<tr>
<td><div align="right">E-mail:
</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td><div align="right">职业:</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">





<div class="codetitle"><a style="CURSOR: pointer" data="93927" class="copybut" id="copybut93927" onclick="doCopy('code93927')"> 代码如下:<div class="codebody" id="code93927">
<?PHP
//本程序用于接收来自HTML页面的表单数据,并输出每个字段
echo "用户的输入如下所示:
";
echo "姓名:".$_GET['username']."
";
echo "密码:".$_GET['password']."
";
echo "密码确认:".$_GET['password2']."
";
echo "性别:".$_GET['sex']."
";
echo "生日:".$_GET['birthday']."
";
echo "E-mail:".$_GET['email']."
";
echo "职业:".$_GET['job']."
";
?>
<div class="codetitle"><a style="CURSOR: pointer" data="71901" class="copybut" id="copybut71901" onclick="doCopy('code71901')"> 代码如下:<div class="codebody" id="code71901">
<?PHP
//本程序用于接收来自HTML页面的表单数据,并输出每个字段
echo "用户的输入如下所示:
";
echo "姓名:".$_POST['username']."
";
echo "密码:".$_POST['password']."
";
echo "密码确认:".$_POST['password2']."
";
echo "性别:".$_POST['sex']."
";
echo "生日:".$_POST['birthday']."
";
echo "E-mail:".$_POST['email']."
";
echo "职业:".$_POST['job']."
";
?>

原文链接:https://www.f2er.com/php/29298.html

猜你在找的PHP相关文章