易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP 压缩文件夹的类!

 <?php
/*
  $Id: PHPZip.php
*/
class PHPZip {
  var $datasec      = array();
  var $ctrl_dir     = array();
  var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
  var $old_offset   = 0;
  function Zip($dir, $zipfilename) {
    if (@function_exists('gzcompress')) {
      @set_time_limit("0");
      $this->openFile($dir,$dir);
      $out = $this -> filezip();
      $fp = fopen($zipfilename, "w");
      fwrite($fp, $out, strlen($out));
      fclose($fp);
    }
  }
  function openFile($path, $zipName) {
     
    $temp_path = $path;
    $temp_zip_path = $zipName;
    $zipDir = $zipName;
    if ($handle = @opendir($path)) {
      while (false !== ($file = readdir($handle))) {
        if($file !='.' and $file !='..'){
          if(ereg('\.' , $file.@basename())) {
            $fd = fopen($path.'/'.$file, "r");
            $fileValue = @fread ($fd, 1024000);
            fclose ($fd);
            $this -> addFile($fileValue, $zipName . '/' . $file);
          } else {
            $this ->openFile($path.'/'.$file, $zipName . '/' . $file);
          }
  &nbs


相关文档:

用php过滤表单提交中的危险html代码

用PHP过滤提交表单的html代码里可能有被利用引入外部危险内容的代码。例如,有些时候用户提交表单中含有html内容,但这可能造成显示页面布局混乱,需要过滤掉。
以下是程序代码:
复制代码
function uhtml($str) 

    $farr = array( 
    ......

php防止页面刷新代码

 可用于php的计数器和表单的提交,防止反复刷新。
复制代码
<?php
session_start();
$allow_sep = "30000";
if (isset($_SESSION["post_sep"]))
{
if (time() - $_SESSION["post_sep"] < $allow_sep)
{
exit("请不要反复刷新");
}
else
{
$_SESSION["post_sep"] = time();
}
}
e ......

asp,asp.net,php,jsp下的301转向代码,整站重定向

 asp,asp.net,php,jsp下的301转向代码
使用.htaccess文件来进行301重定向。
如果空间不支持.htaccess文件,那么我们还可以通过php/asp代码来进行301重定向。
为了将搜索引擎的记录更新到现在的域名上面,做了几个301重定向的东东,给大家分享一下.
asp 301转向代码
在 index.asp 或 default.asp 的最顶部加入以 ......

linux下快速安装apache+php+mysql

 (1)、yum安装mysql
//yum安装
yum -y install mysql mysql_server
//在服务清单中添加mysql服务
chkconfig --add mysqld
//服务启动
service mysqld start
//初始化mysql数据库
/usr/bin/mysql_secure_installation
(2)、安装apache
yum -y install httpd
service httpd start
添加iptables允许访 ......

php:global变量的使用

global定义一个全局变量,这个全局变量不是应用整个网站,而是应用与当前页面(包括require和include文件)文件。
$aa="test";
function test()
{
    global $aa;
    echo $aa;
}
test(); //print test
函数内定义的变量函数外可以调用,在函数外定义的的变量函数内不能使用。
gl ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号