【php开源代码栏目提醒】:网学会员在php开源代码频道为大家收集整理了code5.7.php提供大家参考,希望对大家有所帮助!
<html>
<head><title>运用strcmp函数</title> </head>
<body>
<form action="code5.7.php" method="POST">
<fieldset><table width="90%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="right">用户名:</td>
<td><input type="text" name="userName" value=""></td>
</tr>
<tr><td align="right">密码:</td>
<td><input type="password" name="userPwd" value=""></td>
</tr>
<tr><td align="right"> 重复密码:</td>
<td><input type="pass
word" name="twopwd" value=""></td>
</tr>
<tr><td></td>
<td><input type="submit" name="submit" value="注册"></td>
</tr>
<tr><td colspan="2">
<?php
if(isset($_POST['submit']))
{
if(strcmp($_POST['userPwd'],$_POST['twopwd'])==0)
{
echo "<hr/><li>恭喜你注册成功</li><br/>";
echo "<li>你的用户名是:</li>".$_POST['userName'];
echo "<br/><li>你
注册的密码是:</li>".$_POST['userPwd'];
}
else
{
echo "<hr/><li></li>你注册的密码和重复密码不同,请重新输入你的密码";
}
}
?>
</td></tr></table>
</fieldset></form></body></html>