·建站首页 ·钻石 ·繁體
您的位置: 中国建站之家 -> 网站开发设计 -> PHP教程 -> 聊天室技术(二)-- 登录

聊天室技术(二)-- 登录

作者:未知  来源:转载  发布时间:2005-9-19 9:12:38  发布人:acx

1 页面登陆的基本要素
你可以在我的竹叶看到登陆的表单,这里提供了最基本的登陆表单项
(1)登陆表单
<form method=POST name=chatform action=chat/login.php?action=enter onSubmit="b1_submit();return true;" target="howtodo">
(a)聊天表单的名字为chatform,我使用action=enter作为进入聊天室的入口,如果没有这个参数,则显示登陆页面.
(b)在表单提交时,先调用b1_submit()建立聊天的窗口
(c)聊天的目标窗口为b1_submit()建立的howtodo窗口

(2)表单项
昵称:<input type=text name=name size=15 maxlength="10">
密码:<input type=password name=pass size=15 maxlength="10">
<input type=submit name=submit value=登陆 style="width:100">
<input type=reset name=reset value=重添 style="width:50">
(a)各表单项一定要设定最大允许长度 maxlength

(3)建立聊天窗口的js
<script LANGUAGE="javascript">
function b1_submit(){
chat=window.open('',"howtodo",'Status=no,scrollbars=no,resizable=no');

chat.moveTo(0,0);
chat.resizeTo(screen.availWidth,screen.availHeight);
chat.outerWidth=screen.availWidth;
chat.outerHeight=screen.availHeight;
}
这段代码先打开一个没有状态栏,滚动条,可调整尺寸的howtodo窗口!然后移动到屏幕左上角,然后放大到允许的屏幕大小.

原作者:howtodo
来源:php2000.com

将本文收藏到QQ书签与更多好友分享