聊天室php&mysql(五)
2024-07-24 12:56:45
供稿:网友
第五个页面name="changenick.php"
<?
include "../signup/mysql.php";
//echo $userid;
if($action=="ok")
{
$sql="select * from chat_user_list where userid='$nick'";
$result=mysql_query($sql) or die(mysql_error());
if(!$result) echo "该呢称已被他人占用 请重新填写";
else
{
$sql="update chat_user_list set id='$nick',passwd='$passwd',sex='$sex' where userid='$userid'";
$result=mysql_query($sql)or die(mysql_error());
$sql="update chat_user set id='$nick',passwd='$passwd',sex='$sex' where userid='$userid'";
$result=mysql_query($sql)or die(mysql_error());
}
if($result){
echo "<script language='javascript'> window.close() </script>";
}
}
?>
<html>
<head>
<title>:::feit聊天室:::</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
function mm_reloadpage(init) { //reloads the window if nav4 resized
if (init==true) with (navigator) {if ((appname=="netscape")&&(parseint(appversion)==4)) {
document.mm_pgw=innerwidth; document.mm_pgh=innerheight; onresize=mm_reloadpage; }}
else if (innerwidth!=document.mm_pgw || innerheight!=document.mm_pgh) location.reload();
}
mm_reloadpage(true);
// -->
</script>
</head>
<body bgcolor="#ffffff" text="#000000">
<div id="layer1" ></div>
<div id="layer2" >
<form name="form1" method="post" action="<?echo $php_self?>?action=ok">
<p>
<input type="text" name="nick" size="12" maxlength="20">
</p>
<p>
<input type="text" name="passwd" size="12" maxlength="20">
<input type="hidden" name="userid" value="<?echo $userid ;?>">
</p>
<p>
<select name="sex">
<option value="帅哥">帅哥</option>
<option value="妹妹">美眉</option>
</select>
</p>
<p>
<input type="submit" name="ok" value="更改" align="center">
</p>
</form>
</div>
<div id="layer3" >用户呢称</div>
<div id="layer4" >用户密码</div>
<div id="layer5" >性别</div>
</body>
</html>