极乐门资源网 Design By www.ioogu.com
INDEX.PHP
代码如下!

<?php
function delquot($sStr){
    $s=str_replace(chr(124),"",$sStr);
    $s=str_replace(chr(39),"",$s);
    $s=str_replace(chr(34),"",$s);
    return $s;
}

if ($cmdYes=="进   入"){
    $sUserName=htmlspecialchars(trim(delquot($sUserName)));
    if ($sUserName=="superldz" && $sPass="superldz"){
        $sUserID=1;
        include("chtmain.php3");
        exit();
    }
    else{
        $ConnID=@odbc_connect("jtfcht","admin","");
        if ($ConnID){
            $result=@odbc_exec($ConnID,"SELECT UserID,UserName,PassWord,RoomID,Sex FROM User WHERE UserName='".$sUserName."'");
            if (@odbc_fetch_into($result,0,&$rArr)){
                $sUserID=$rArr[0];
                if ($rArr[2]==$sPass){
                    if ($rArr[3]==0){
                        @odbc_exec($ConnID,"UPDATE User SET RoomID=1,LstDate='".date("Y.m.d")."',ToID=0,ToName='大家',Secret=False,FirstTime=True,LstTime=".time()." WHERE UserID=".$sUserID);
                        if ($rArr[4])
                            @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$rArr[0].", '".$rArr[1]."', '".getenv("REMOTE_ADDR")."', 0, '大家', '".date("H:i:s")."', '<font color=gray>【系统消息】欢迎<font color=#FF9933>".$rArr[1]."</font>来到了这个聊天室</font>', False, 1)");
                        else
                            @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$rArr[0].", '".$rArr[1]."', '".getenv("REMOTE_ADDR")."', 0, '大家', '".date("H:i:s")."', '<font color=gray>【系统消息】欢迎<font color=#3399FF>".$rArr[1]."</font>来到了这个聊天室</font>', False, 1)");
                        include("chtmain.php3");
                        exit();
                    }
                    else $sErrText="登录出错,<font color="red">已经有人用这个名字登录了</font>!";
                }
                else $sErrText="登录出错,<font color="red">口令不正确</font>!";
            }
            else $sErrText="登录出错,<font color="red">用户没注册</font>!";
            @odbc_close($ConnID);
        }
        else $sErrText="<font color="red">系统故障</font>,暂时无法登录";
    }
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>温酒吧聊天室</title>
<script language="JavaScript">
<!--
function NameGotFocus( ) {
    document.frmLogin.sUserName.focus();
}

function CheckValid() {
    if (document.frmLogin.sUserName.value == "") {
        alert( "请输入昵称。");
        document.frmLogin.sUserName.focus();
        return false;
    }
    if (document.frmLogin.sPass.value == "") {
        alert( "请输入口令。");
        document.frmLogin.sPass.focus();
        return false;
    }
    return true;
}
//-->
</script>
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body onload="NameGotFocus()">
<p>&nbsp;</p>
<table align="center" border="0" cellPadding="0" cellSpacing="0" width="90%">
    <tr>
        <td rowspan="3" align="right" width="30%" valign="top"><img alt="Cht" src="cht.jpg" WIDTH="192" HEIGHT="384"></td>
        <td height="170" align="middle">
            <embed src="logo.swf" width="300" height="70"></embed>
            <p>本页永久域名:<a href="http://jtf.126.com/">http://jtf.126.com/</a>
        </td>
    </tr>
    <tr>
        <td align="middle">
        <table align="center" border="0" cellPadding="0" cellSpacing="0" width="80%">
            <tr>
                <td align="center">
                    <div align="center"><center><table border="0" width="100%">
                        <tr>
                            <td><hr size="1" color="#800000"></td>
                        </tr>
<?php
if ($cmdYes=="进   入"){
?>
                        <tr>
                            <td align="center"><?php echo $sErrText; ?></td>
                        </tr>
                        <tr>
                            <td><hr size="1" color="#800000"></td>
                        </tr>
<?php
}
?>
                    </table></center></div>
                    <div align="center"><center><table border="1" width="90%" cellspacing="1" cellpadding="5">
                        <form method="post" name="frmLogin" target="_top" action="index.php3">
                        <tr>
                            <td colspan="3">在此登录</td>
                        </tr>
                        <tr>
                            <td width="33%" align="right">昵称:</td>
                            <td width="33%"><input name="sUserName" size="15" maxlength="30"></td>
                            <td width="34%">&nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right">口令:</td>
                            <td><input type="password" name="sPass" size="15" maxlength="10"></td>
                            <td align="center"><input type="submit" value="进   入" name="cmdYes" onClick="return CheckValid();"></td>
                        </tr>
                        <tr>
                            <td colspan="3" align="center">点击<a href="newuser.php3">这里</a>注册新用户</td>
                        </tr>
                        </form>
                    </table></center></div>
                    <div align="center"><center><table border="0" width="100%">
                        <tr>
                            <td colspan="3"><hr size="1" color="#800000"></td>
                        </tr>
                        <tr>
                            <td width="5%">&nbsp;</td>
                            <td>欢迎进入温酒吧聊天室,现介绍本聊天室功能主要有:<ol>
                                <li>显示右侧上面是房间列表、下面是你所在的房间里的客人的列表</li>
                                <li>悄悄话、动作、随机表情功能</li>
                                <li>可以指定讲话的对方</li>
                                <li>建立带密码的房间,只有知道口令的人才能进入</li>
                                <li>房主可以拆房和将本房间里的人踢到大厅</li>
                                <li>命令行中可以使用如下命令:</li>
                                    <ul>
                                        <li>/w 找人</li>
                                        <li>/t 想</li>
                                        <li>/: 自定义动作</li>
                                        <li>// 系统动作</li>
                                    </ul>
                                <li>命令行中进行了过滤,不允许出现 HTML TAG</li>
                            </ol></td>
                            <td width="5%">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="3"><hr size="1" color="#800000"></td>
                        </tr>
                    </table></center></div>
                </td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
<script>
document.write("<a href="http://view.gznet.com/cgi-bin/rl_views.cgi?UID=10031505" target=sxrl>");  
document.write("<img src="http://refer.gznet.com/cgi-bin/rl_refer2.cgi?UID=10031505&refer="+escape(top.document.referrer)+"" width=88 height=31 border=0 alt="飞华统计专家">");  
document.write("</a>");  
document.write("<a href=http://best.netease.com/cgi-bin/view/viewbasic.cgi?jtfcht target=_blank><img src=http://best.netease.com/cgi-bin/log.cgi?user=jtfcht&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" border=0 alt='网易中文排行榜' ></a>");
</script>
        </td>
    </tr>
</table>
</body>
</html>  

【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    
标签:
|用P|PH|HP|P和|和A|AC|CC|CE|ES|SS|S写|写聊|聊天|天室|室一|一|

极乐门资源网 Design By www.ioogu.com
极乐门资源网 免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
极乐门资源网 Design By www.ioogu.com

评论“用PHP和ACCESS写聊天室(一)”

暂无用PHP和ACCESS写聊天室(一)的评论...

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。