PHP程序百行代码快速构建简易聊天室方法(2)
//校验登陆
if ($action=='login')
{
if (isset($_POST['login_user']) && !empty($_POST['login_user'])) {
$username = $_POST['login_user'];
} else {
$username = "游客";
}
session_register('username');
save_online($username, get_client_ip());
header("location:".SCRIPT."?action=chat");
}
//开始聊天www.knowsky.com
if ($action=="chat")
{
$online_sum = get_online_sum();
echo "<head><title>[ ".CHAT_NAME." ]</title></head><center>
<body bgcolor=#C4BFB9 style='font-size:12px;'>
<div style='border:1px solid #999966; width:802px;height:450'>
<iframe src='".SCRIPT."?action=show'
name=show_win width=800 height=450 scrolling=auto frameborder=0></iframe>
</div><br>
<marquee width=70% scrollamount=2> ".AD_MSG." </marquee>
[当前在线:$online_sum]
<iframe src='".SCRIPT."?action=say' name=say_win width=800
height=60 scrolling=no frameborder=0>
";
}
//说话界面
if ($action=="say")
{
echo "<head><title>[ ".CHAT_NAME." ]</title></head><center>
<body bgcolor=#C4BFB9 style='font-size:12px;'>
<form action=".SCRIPT."?action=save method=post name=chat
onSubmit='return check()'>
[".$_SESSION['username']."]说:<input type=tex
相关新闻>>
- 发表评论
-
- 最新评论 更多>>