PHP的一个基础知识 表单提交

前端之家收集整理的这篇文章主要介绍了PHP的一个基础知识 表单提交前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

register.PHP:
<div class="codetitle"><a style="CURSOR: pointer" data="21183" class="copybut" id="copybut21183" onclick="doCopy('code21183')"> 代码如下:

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


<Meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<a href="https://www.jb51.cc/tag/zhuce/" target="_blank" class="keywords">注册</a><a href="https://www.jb51.cc/tag/yemian/" target="_blank" class="keywords">页面</a>


<form action="request.PHP" method="post" name="registForm">
<table width="330" border="0" align="center" cellpadding="5" bgcolor="#eeeeee">
<tr>
<td width="40%">用户名:</td>
<td><input name="username" type="text" id="username"/></td>
</tr>
<tr>
<td>姓名:</td>
<td><input name="name" type="text" id="name"/></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="pwd" type="text" id="pwd"/></td>
</tr>
<tr>
<td>邮箱:</td>
<td><input name="email" type="text" id="email"/></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="提交" name="submit"/>
<input type="reset" value="重置" name="button"/>
</td>
</tr>
</table>




request.PHP
<div class="codetitle"><a style="CURSOR: pointer" data="12897" class="copybut" id="copybut12897" onclick="doCopy('code12897')"> 代码如下:
<div class="codebody" id="code12897">
<?PHP
$username = $_POST['username'];
$name = $_POST['name'];
$pwd = $_POST['pwd'];
$email = $_POST['email'];
//print_r($username);
if(!empty($username))
{
echo "您填写的信息为:
\n";
echo "用户名: $username
\n";
echo "姓名: $name
\n";
echo "密码: $pwd
\n";
echo "邮箱: $email
\n";
}
print_r($_POST)
//echo "aaaa";
?>



当然,你也可以把request跟regiser.PHP写到一起。

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

猜你在找的PHP相关文章