WEB开发网
开发学院WEB开发PHP 聊天室php&mysql(五) 阅读

聊天室php&mysql(五)

 2008-02-15 17:59:33 来源:WEB开发网   
核心提示:第五个页面name="changenick.php" <? include "../signup/MySQL(和PHP搭配之最佳组合).php"; //echo $userid; if($action=="ok") { $
第五个页面name="changenick.php"


<?  
include "../signup/MySQL(和PHP搭配之最佳组合).php";
//echo $userid;
if($action=="ok")
{
$sql="select * from chat_user_list where userid='$nick'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql) or die(MySQL(和PHP搭配之最佳组合)_error());
if(!$result) echo "该呢称已被他人占用 请重新填写";
else  
  {
$sql="update chat_user_list set id='$nick',passwd='$passwd',sex='$sex' where userid='$userid'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());

$sql="update chat_user set id='$nick',passwd='$passwd',sex='$sex' where userid='$userid'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_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" style="position:absolute; left:40px; top:28px; width:293px; height:202px; z-index:1; background-color: #6699FF; layer-background-color: #6699FF; border: 1px none #000000"></div>
<div id="Layer2" style="position:absolute; left:144px; top:54px; width:126px; height:70px; z-index:2"> 
 <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>

上一页 下一页

Tags:聊天室 php mysql

编辑录入:coldstar [复制链接] [打 印]
赞助商链接