聊天室php&mysql(五)
更新時(shí)間:2006年10月09日 00:00:00 作者:
第五個(gè)頁(yè)面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 "該呢稱已被他人占用 請(qǐng)重新填寫(xiě)";
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" 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>
</div>
<div id="Layer3" style="position:absolute; left:72px; top:58px; width:72px; height:20px; z-index:3">用戶呢稱</div>
<div id="Layer4" style="position:absolute; left:72px; top:99px; width:71px; height:23px; z-index:4">用戶密碼</div>
<div id="Layer5" style="position:absolute; left:82px; top:139px; width:58px; height:20px; z-index:5">性別</div>
</body>
</html>
<?
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 "該呢稱已被他人占用 請(qǐng)重新填寫(xiě)";
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" 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>
</div>
<div id="Layer3" style="position:absolute; left:72px; top:58px; width:72px; height:20px; z-index:3">用戶呢稱</div>
<div id="Layer4" style="position:absolute; left:72px; top:99px; width:71px; height:23px; z-index:4">用戶密碼</div>
<div id="Layer5" style="position:absolute; left:82px; top:139px; width:58px; height:20px; z-index:5">性別</div>
</body>
</html>
相關(guān)文章
PHP函數(shù)之日期時(shí)間函數(shù)date()使用詳解
date()函數(shù)是我們?cè)趐hp開(kāi)發(fā)中常碰到并且會(huì)使用到的一個(gè)日期函數(shù),下面我來(lái)給大家介紹date()函數(shù)的一些基本扮靚和方法,有需要了解的朋友可進(jìn)入?yún)⒖?/div> 2013-09-09
PHP4實(shí)際應(yīng)用經(jīng)驗(yàn)篇(8)
PHP4實(shí)際應(yīng)用經(jīng)驗(yàn)篇(8)...2006-10-10
在面向?qū)ο缶幊讨? 最通常的方法是一個(gè)new操作符產(chǎn)生一個(gè)對(duì)象實(shí)例,new操作符就是用來(lái)構(gòu)造對(duì)象實(shí)例的。但是在一些情況下, new操作符直接生成對(duì)象會(huì)帶來(lái)一些問(wèn)題。舉例來(lái)說(shuō), 許多類型對(duì)象的創(chuàng)造需要一系列的步驟: 你可能需要計(jì)算或取得對(duì)象的初始設(shè)置; 選擇生成哪個(gè)子對(duì)象實(shí)例; 或在生成你需要的對(duì)象之前必須先生成一些輔助功能的對(duì)象。 在這些情況, 新對(duì)象的建立就是一個(gè) “過(guò)程”,不僅是一個(gè)操作,像一部大機(jī)器中的一個(gè)齒輪傳動(dòng)。2008-06-06
構(gòu)建簡(jiǎn)單的Webmail系統(tǒng)
構(gòu)建簡(jiǎn)單的Webmail系統(tǒng)...2006-10-10最新評(píng)論

