网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > PHP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.不需要mod_rewrite直接使用php实.
.PHP程序加速探索之服务器负载测试.
.PHP程序加速探索之脚本执行速度测.
.PHP Google的translate API代码.
.在PHP中执行系统外部命令.
.PHP集成FCK的函数代码.
.PHP目录管理函数小结.
.生成sessionid和随机密码的例子.
.PHP中使用FCKeditor2.3.2配置.
.PHP 5.3中新增的魔术常量__DIR__.
.编写PHP的安全策略.
.怎样在php中使用PDF文档功能.
.php调用存储过程返回结果集,解决.
.PHP的PDO类教程.
.在PHP中全面阻止SQL注入式攻击之.
.3种平台下安装php4经验点滴.
.正则表达式经验谈.
.如何在PHP中使用Oracle数据库(3).
.PHP常用函数推荐.
.对Javascript和select部件的结合.

PHP+Javascript模拟Matrix画面

发表日期:2000-12-24


    直接存为*.php文件运行即可。

<?
  $color_back="#000000";
  $number_w=8;
  $number_h=6;
  $space=1;
  $font_size=20;
  $speed=0;
?>
<html>
<head>
<title>The Matrix</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="javascript">
// *****************************************************************
//                   Written By Caocao
//                   caocao@eastday.com
//                   http://caocao.oso.com.cn
// *****************************************************************
number_h=<? echo $number_h;?>;
number_w=<? echo $number_w;?>;
step=5;
text=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
grad=new Array("#000000","#004000","#008000","#00C000","#00FF00");

function line()
{
  this.start=100;
  this.end=60;
  this.restart=0;
}

function randchar()
{
  return (text[Math.round(Math.random()*25)]);
}

function initial()
{
  matrix=new Array();
  light=new Array();
  for (i=0;i<number_h;i++)
  {
    for (j=0;j<number_w;j++)
    {
      matrix[i*number_h+j]="<? echo $color_back;?>";
    }
  }
  for (j=0;j<number_w;j++)
  {
    light[j]=new line();
  }
}

function new_light()
{
  for (j=0;j<number_w;j++)
  {
    if (light[j].restart==0)
    {
      light[j].start=0;
      light[j].end=-10-Math.round(Math.random()*20);
      light[j].restart=light[j].end-Math.round(Math.random()*20);
    }
    else
    {
      light[j].start++;
      light[j].end++;
      light[j].restart++;
    }
  }
}

function new_color(i,j)
{
  if ((light[j].start-i)<5&&(light[j].start-i)>0)
  {
    return (light[j].start-i);
  }
  if ((i-light[j].end)<5&&(i-light[j].end)>0)
  {
    return (i-light[j].end);
  }
  if ((i-light[j].end)>4&&(light[j].start-i)>4)
  {
    return (4);
  }
  return (0);
}

function display()
{
  for (i=0;i<number_h;i++)
  {
    for (j=0;j<number_w;j++)
    {
      eval("w"+i+"h"+j).innerHTML="<font color="+grad[new_color(i,j)]+">"+randchar()+"</font>";
    }
  }
}

function show()
{
  new_light();
  display();
  setTimeout("show()",<? echo $speed;?>);
}
</script>
<style type="text/css">
<!--
<?
  echo ".size,tr,td {  font-size: ".$font_size."pt; line-height: ".$font_size."pt ;color:#00FF00}n";
?>
-->
</style>
</head>

<?
  echo "<body bgcolor=".$color_back.">";

  echo "<table width=".($number_w*$font_size)." border=0 cellspacing=".$space." cellpadding=0>";
  for ($i=0;$i<$number_h;$i++)
  {
    echo "<tr>";
    for ($j=0;$j<$number_w;$j++)
    {
      echo "<td id=w".$i."h".$j.">M</td>";
    }
    echo "</tr>";
  }
  echo "</table>";
?>

<script language="javascript">
  initial();
  show();
</script>
</body>
</html>

上一篇:用php和MySql来与ODBC数据连接 人气:11455
下一篇:PHP与Javascript的两种交互方式 人气:14768
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐