当前位置:首页> PHP教程> PHP精通
关键字
文章内容
聊天室技术(二)-- 登录
 
 
修改时间:[2008/08/01 02:39]    阅读次数:[816]    发表者:[起缘]
 
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