仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1093|回复: 19
打印 上一主题 下一主题

[学习教程] PHP教程之采取行写体例的聊天法式(之三)

[复制链接]
若天明 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-4 00:04:56 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
不过还好,PHP语言给出的语法错误很详细,只要稍微熟悉一点之后,看错误提示就能很容易找出错误所在的。PHP还有一个特别好用的调试功能,在PHP语句中,你可以随时用echo来输出结果。   ltsayno.php
该法式为体系的中心,处置所联系关系的一切函数信息

<?session_start();?>
<html>
<head>
<title>讲话区</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body{background:59ACFF;color:black}
body{font-size:9pt;line-height:160%}
table{font-size:10.5pt}
input{font-size:9pt}
A{color:black;text-decoration:none}
A:Hover{text-decoration:underline}
</style>
<script Language=JavaScript>

//人人的信息
function dj(){
  document.forms[0].towho.options[0].value="人人";
  document.forms[0].towho.options[0].text="人人";
  document.forms[0].saystemp.focus();
}

//举措,把该举措的信息添加到讲话板中
function rc(list){
  if (list!="0"){
     document.forms[0].saystemp.value=list;
     document.forms[0].saystemp.focus();
  }
}


function backsays() {
  document.forms[0].saystemp.value=document.forms[0].oldsays.value;
  document.forms[0].saystemp.focus();
  return true;
}


function checksays(){
  if(document.fyq.saystemp.value==""){
    alert("请输出讲话。");
    document.fyq.saystemp.focus();
    return false;
   }
  if(document.fyq.saystemp.value==document.fyq.oldsays.value){
     alert("内容不成反复。");
     document.fyq.saystemp.focus();
     document.fyq.saystemp.select();
     return false;
    }
    document.fyq.oldsays.value=document.fyq.saystemp.value;
    document.fyq.saystemp.value="";
    document.fyq.saystemp.focus();
    document.fyq.send.disabled=1;
    setTimeout("document.fyq.send.disabled=0",30);
    return true;
}

function cls(){
  parent.f1.location.href="about:blank";
  setTimeout("write(1)",500);
}

function write(cls){
  var ffsize;   
  var lheight;  
  if (cls==1){
     ffsize=parent.f2.document.fyq.fontsize.value;
     lheight=parent.f2.document.fyq.lineheight.value;
   }else{
     ffsize='10.5';
     lheight='145';
   }
  parent.f1.document.open();
  parent.f1.document.writeln("<html><head><title>对话区</title>");
  parent.f1.document.writeln("<meta http-equiv=Content-Type content="text/html; charset=gb2312">");
  parent.f1.document.writeln("<style type=text/CSS>.t{color:FF00FF;font-size:9pt;}");
  parent.f1.document.writeln("body{font-family:"宋体";font-size:"+ffsize+"pt;line-height:" + lheight + "%;}A{text-decoration:none}A:Hover{text-decoration:underline}A:visited{color:blue}</style></head>");
  parent.f1.document.writeln("<Script Language="JavaScript1.1">");
  parent.f1.document.writeln("var autoScrollOn=1;");
  parent.f1.document.writeln("var scrollOnFunction;var scrollOffFunction;");
  parent.f1.document.writeln("function scrollit()");
  parent.f1.document.writeln("{if(!parent.f2.document.fyq.as.checked)");
parent.f1.document.writeln("{autoScrollOn=0;return true;}else{autoScrollOn=1;StartUp();return true;}}");
parent.f1.document.writeln(" function scrollWindow()");
parent.f1.document.writeln("{if(autoScrollOn==1)");
parent.f1.document.writeln("{this.scroll(0,65000);setTimeout('scrollWindow()',200);}}");
parent.f1.document.writeln("function scrollOn(){autoScrollOn=1;scrollWindow();}");
parent.f1.document.writeln("function scrollOff(){autoScrollOn=0;}");
parent.f1.document.writeln("function StartUp()");
parent.f1.document.writeln("{parent.onblur=scrollOnFunction;");
parent.f1.document.writeln("parent.onfocus=scrollOffFunction;scrollWindow();}");
parent.f1.document.writeln("scrollOnFunction=new Function('scrollOn()');");
parent.f1.document.writeln("scrollOffFunction=new Function('scrollOff()');");
parent.f1.document.writeln("StartUp();</script>");
parent.f1.document.writeln("<body bgcolor=ffffff text=000000>");
parent.f1.document.writeln("<hr size=1><center>接待惠临PHP无刷新功效聊天室!</center><hr size=1>");
parent.tforlt4.location.href="lt4.php";
document.fyq.saystemp.focus();
}


function sw(list){
document.fyq.towho.options[0].value=list;
document.fyq.towho.options[0].text=list;
document.fyq.saystemp.focus();
}

function sw11(username){
  var usna;
  usna=username.substring(1,username.length-1);
  document.fyq.towho.options[0].value=usna;
  document.fyq.towho.options[0].text=usna;
  document.fyq.saystemp.focus();
  return;
}

function w(un,sa,tn,dt){
  var show;
  show="【"+tn+" 讲话】";
  show=show+"<a href=javascript:parent.f2.sw('[" + un + "]'); target=f2>" + un + "</a>:" + sa + "<font class=t>"
  show=show + " (" + dt + ")</font><br>";
  parent.f1.document.writeln(show);
}

function nw(zt,un,tw,sa){
   parent.f2.document.fyq.addsign.options[0].selected=true;
   var show="";
  var sw_un=un.indexOf(">");
  var yun=un.substring(sw_un+1,un.length-7);
  var name_self="<?echo $uname;?>";
  if (zt==0){
     if (name_self!=un && name_self!=tw){
        show="<a href=javascript:parent.f2.sw('" + un + "'); target=f2>" + un + "</a>对"+"<a href=javascript:parent.f2.sw('" + tw + "'); target=f2>" + tw + "</a>说:"+sa+"<br>";
       parent.f1.document.writeln(show);
     }else{
        if(name_self==un){
           show="<font color=red>〖"+un+"〗</font>对";
           show=show+"<a href=javascript:parent.f2.sw('" + tw + "'); target=f2>" + tw + "</a>说:" + sa + "<br>";
           parent.f1.document.writeln(show);
        }else{
             show="<a href=javascript:parent.f2.sw('" + un + "'); target=f2>" + un + "</a>对";
             show=show+"<font color=red>〖"+tw+"〗</font>说:" + sa + "<br>";
             parent.f1.document.writeln(show);
             }
       }
   }
}

function change_color(){
   var change_color=document.fyq.sayscolor.options[document.fyq.sayscolor.selectedIndex].value;
   document.fyq.saystemp.style.color=change_color;
   document.fyq.saystemp.focus();
}
</script>

</head>
接触MYSQL,开始设计数据库程序
若天明 该用户已被删除
沙发
 楼主| 发表于 2015-3-14 10:21:50 | 显示全部楼层
我要在声明一下:我是个菜鸟!!我对php这门优秀的语言也是知之甚少。但是我要在这里说一下php在网站开发中最常用的几个功能:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-21 08:21

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表