zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

聊天室php&mysql(五)

mysqlampPHP 聊天室
2023-06-13 09:13:43 时间
第五个页面name="changenick.php"


<?   
include"../signup/mysql.php";
//echo$userid;
if($action=="ok")
{
$sql="select*fromchat_user_listwhereuserid="$nick"";
$result=mysql_query($sql)ordie(mysql_error());
if(!$result)echo"该呢称已被他人占用请重新填写";
else   
    {
$sql="updatechat_user_listsetid="$nick",passwd="$passwd",sex="$sex"whereuserid="$userid"";
$result=mysql_query($sql)ordie(mysql_error());

$sql="updatechat_usersetid="$nick",passwd="$passwd",sex="$sex"whereuserid="$userid"";
$result=mysql_query($sql)ordie(mysql_error());
     }
if($result){
           echo"<scriptlanguage="JavaScript">window.close()</script>";
           }

}


?>

<html>
<head>
<title>:::FEIT聊天室:::</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<scriptlanguage="JavaScript">
<!--
functionMM_reloadPage(init){  //reloadsthewindowifNav4resized
  if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){
    document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage;}}
  elseif(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH)location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<bodybgcolor="#ffffff"text="#000000">

<divid="Layer1"style="position:absolute;left:40px;top:28px;width:293px;height:202px;z-index:1;background-color:#6699FF;layer-background-color:#6699FF;border:1pxnone#000000"></div>
<divid="Layer2"style="position:absolute;left:144px;top:54px;width:126px;height:70px;z-index:2">  
  <formname="form1"method="post"action="<?echo$PHP_SELF?>?action=ok">
    <p>  
      <inputtype="text"name="nick"size="12"maxlength="20">
    </p>
    <p>  
      <inputtype="text"name="passwd"size="12"maxlength="20">
      <inputtype="hidden"name="userid"value="<?echo$userid;?>">
    </p>
    <p>  
      <selectname="sex">
        <optionvalue="帅哥">帅哥</option>
        <optionvalue="妹妹">美眉</option>
      </select>
    </p>
    <p>
      <inputtype="submit"name="ok"value="更改"align="center">
    </p>
  </form>
</div>
<divid="Layer3"style="position:absolute;left:72px;top:58px;width:72px;height:20px;z-index:3">用户呢称</div>
<divid="Layer4"style="position:absolute;left:72px;top:99px;width:71px;height:23px;z-index:4">用户密码</div>
<divid="Layer5"style="position:absolute;left:82px;top:139px;width:58px;height:20px;z-index:5">性别</div>
</body>
</html>