仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1069|回复: 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-2-4 08:41:00 | 只看该作者
没接触过框架的人,也不用害怕,其实框架就是一种命名规范及插件,学会一个框架其余的框架都很好上手的。
小妖女 该用户已被删除
板凳
发表于 2015-2-9 20:18:06 | 只看该作者
对于懒惰的朋友,我推荐php的集成环境xampp或者是wamp。这两个软件安装方便,使用简单。但是我还是强烈建议自己动手搭建开发环境。
若相依 该用户已被删除
地板
发表于 2015-2-14 21:16:08 | 只看该作者
本文当是我的笔记啦,遇到的问题随时填充
admin 该用户已被删除
5#
发表于 2015-2-28 02:27:47 | 只看该作者
说点我烦的低级错误吧,曾经有次插入mysql的时间 弄了300年结果老报错,其实mysql的时间是有限制的,大概是到203X年  具体的记不清啦,囧。
透明 该用户已被删除
6#
发表于 2015-2-28 21:29:09 | 只看该作者
基础有没有对学习php没有太大区别,关键是兴趣。
爱飞 该用户已被删除
7#
发表于 2015-3-6 15:49:41 | 只看该作者
本人接触php时间不长,算是phper中的小菜鸟一只吧。由于刚开始学的时候没有名师指,碰过不少疙瘩,呗很多小问题卡过很久,白白浪费不少宝贵的时间,在次分享一些子的学习的心得。
柔情似水 该用户已被删除
8#
发表于 2015-3-13 04:06:50 | 只看该作者
开发工具也会慢慢的更专业,每个公司的可能不一样,但是zend studio是个大伙都会用的。
若天明 该用户已被删除
9#
 楼主| 发表于 2015-3-14 10:21:50 | 只看该作者
我要在声明一下:我是个菜鸟!!我对php这门优秀的语言也是知之甚少。但是我要在这里说一下php在网站开发中最常用的几个功能:
只想知道 该用户已被删除
10#
发表于 2015-3-17 10:33:56 | 只看该作者
首先我是坚决反对新手上来就用框架的,因为对底层的东西一点都不了解,造成知识上的真空,会对以后的发展不利。我的观点上手了解下框架就好,代码还是手写。当然啦如果是位别的编程语言的高手的话,这个就另当别论啦。
乐观 该用户已被删除
11#
发表于 2015-3-19 21:02:22 | 只看该作者
找到的的资料很多都是在论坛里的,需要注册,所以我一般没到一个论坛都注册一个id,所有的id都注册成一样的,这样下次再进来的时候就不用重复注册啦。当然有些论坛的某些资料是需要的付费的。
金色的骷髅 该用户已被删除
12#
发表于 2015-3-21 11:47:04 | 只看该作者
作为一个合格的coder 编码的规范是必须,命名方面我推崇“驼峰法”,另外就是自己写的代码最好要带注释,不然时间长了,就算是自己的代码估计看起来都费事,更不用说别人拉。
13#
发表于 2015-3-27 11:11:08 | 只看该作者
这些都是最基本最常用功能,我们这些菜鸟在系统学习后,可以先对这些功能深入研究。
不帅 该用户已被删除
14#
发表于 2015-4-1 17:09:58 | 只看该作者
不禁又想起那些说php是草根语言的人,为什么认得差距这么大呢。
莫相离 该用户已被删除
15#
发表于 2015-4-5 08:13:11 | 只看该作者
为了以后维护的方便最好是代码上都加上注释,“予人方便,自己方便”。此外开发文档什么的最好都弄齐全。我觉得这是程序员必备的素质。虽然会消耗点很多的时间。但是确实是非常有必要的。
分手快乐 该用户已被删除
16#
发表于 2015-4-11 18:23:28 | 只看该作者
当留言板完成的时候,下步可以把做1个单人的blog程序,做为目标,
精灵巫婆 该用户已被删除
17#
发表于 2015-4-18 02:56:08 | 只看该作者
写js我最烦的就是 ie 和 firefox下同样的代码 结果显示的结果千差万别,还是就是最好不要用遨游去调试,因为有时候遨游是禁用js的,有可能代码是争取结果被遨游折腾的认为是代码写错。
小女巫 该用户已被删除
18#
发表于 2015-4-28 09:21:20 | 只看该作者
本文当是我的笔记啦,遇到的问题随时填充
深爱那片海 该用户已被删除
19#
发表于 2015-5-3 15:07:45 | 只看该作者
有位前辈曾经跟我说过,phper 至少要掌握200个函数 编起程序来才能顺畅点,那些不熟悉的函数记不住也要一拿手册就能找到。所以建议新手们没事就看看php的手册(至少array函数和string函数是要记牢的)。
飘灵儿 该用户已被删除
20#
发表于 2015-5-6 12:09:39 | 只看该作者
本文当是我的笔记啦,遇到的问题随时填充
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-4-30 11:12

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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