php——学习笔记,验证密码是否一致,使用print_r以及colspan表情

来源:互联网 发布:java检测内存泄露 编辑:程序博客网 时间:2024/04/29 23:08

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>验证两次输入的密码是否相等</title>


</head>
<body>
<table width="409" border="2" cellpadding="20" cellspacing="2" bordercolor="#9900FF"bgcolor="#3366FF">
  <form name="form1" method="post" action="">
    <tr align="center">
      <td height="24" colspan="20" class="style1"> 验证两次输入的密码是否相等 </td>
    </tr>
    <tr>
      <td width="108" height="20" align="center" class="style1">用户名:</td>
      <td width="295" class="style3"><input name="username" type="text" id="username" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td height="20" align="center" class="style1">密码:</td>
      <td class="style3"><input name="password" type="password" id="password" size="20" maxlength="50"> 
        &nbsp;<span class="STYLE4">* 密码不能为空</span></td>
    </tr>
    <tr>
      <td height="18" align="center" class="style1">密码确认:</td>
      <td class="style3"><input name="password1" type="password" id="password1" size="20" maxlength="50">
&nbsp;<span class="STYLE4">* 确认密码不能为空</span> </td>
    </tr>
    <tr>
      <td height="37" align="center">&nbsp;</td>
      <td ><input type="submit" name="Submit" value="提交">
        <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </form>
</table>


<table border="1">
    <tr>
        <th>www.dreamdu.com</th>
        <th>.com域名的数量</th>
        <th>.cn域名的数量</th>
        <th>.net域名的数量</th>
    </tr>
    <tr>
        <td>2003年</td>
        <td>1000</td>
        <td colspan="2">2000+3000</td>
    </tr>
    <tr>
        <td>2004年</td>
        <td>4000</td>
        <td>5000</td>
        <td>6000</td>
    </tr>
    <tr>
        <td>2005年</td>
        <td>7000</td>
        <td>8000</td>
        <td>9000</td>
    </tr>
    <tr>
        <td>总数</td>
        <td colspan="3">24000</td>
    </tr>
</table>
</body>
</html>
<?php 




if(!empty($_POST["Submit"]))
{


$password=$_POST["password"];
$password1=$_POST["password1"];
if($password==$password1)
{
echo "注册成功!";
}
else
{
echo "两次输入的密码不一致!";
}
}
$_POST是一个数组,里面包含着所有post到服务器的值,而这些值的名字就是你写的name名



$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x','y','z'));
print_r ($a);


?>


0 0
原创粉丝点击