图片计数器实例教程

以了计数器的漂亮,我们经常会用图片做统计的数字1,2到10我们只要做0,9的图片数字,然后用下面的方法就来做出漂亮的计数器出来哦。


阅读全文

php 设置cookie高级用法

function getvis(&$pagesid,&$retime) {
  global $err,$conf,$HTTP_COOKIE_VARS,$_COOKIE;

  if(isset($_COOKIE['ant'])) $cot=$_COOKIE['ant'];
  elseif(isset($HTTP_COOKIE_VARS['ant'])) $cot=$HTTP_COOKIE_VARS['ant'];
  else $cot='';
  $cos=preg_split("/x/",$cot);
  $max=sizeof($cos);
  for($c=0;$c<$max;$c++) {
    if(strlen($cos[$c])==10) {
      $id=substr($cos[$c],0,2);
      eval("$id=0x$id;");
      $anct[$id]=$cos[$c];
    }
  }

阅读全文

php导出mysql成cvs execel表

<?php
include_once(dirname(__FILE__).'../../Inc/Conn.php');
include_once(dirname(__FILE__).'../../photo/Inc/function.php');
$Date = date("Y-m-d");
$Filename = $Date.'_'.date("h_i_s").".csv";

阅读全文

php 读取远程网站内容[反盗连]

这是一款利用php fsockopen来读取远程服务器的内容哦,下面这段程序的做法就是可以反盗连呢,好了下面来看看吧。

 function DownloadToString()
   {
       $crlf = "rn";
       $response="";
       // generate request
       $req = 'GET ' . $this->_uri . ' HTTP/1.0' . $crlf
           .    'Host: ' . $this->_host . $crlf
           .    $crlf;
      
       // fetch
       $this->_fp = @fsockopen(($this->_protocol == 'https' ? 'ssl://' : '') . $this->_host, $this->_port);
       @fwrite($this->_fp, $req);
       while(is_resource($this->_fp) && $this->_fp && !feof($this->_fp))
           $response .= fread($this->_fp, 1024);
       @fclose($this->_fp);
      
       // split header and body
       $pos = strpos($response, $crlf . $crlf);
       if($pos === false)
           return($response);
       $header = substr($response, 0, $pos);
       $body = substr($response, $pos + 2 * strlen($crlf));
      
       // parse headers
       $headers = array();
       $lines = explode($crlf, $header);
       foreach($lines as $line)
           if(($pos = strpos($line, ':')) !== false)
               $headers[strtolower(trim(substr($line, 0, $pos)))] = trim(substr($line, $pos+1));
      
       // redirection?
       if(isset($headers['location']))
       {
           $http = new HTTPRequest($headers['location']);
           return($http->DownloadToString($http));
       }
       else
       {
           return($body);
       }
   }
}

阅读全文

php 域名处理函数

下面这款个一个是判断输入的域名是不是合法的,然后再把http,https,ftp进行处理,分析再发送

function _scan_url()
   {
       $req = $this->_url;
      
       $pos = strpos($req, '://');
       $this->_protocol = strtolower(substr($req, 0, $pos));
      
       $req = substr($req, $pos+3);
       $pos = strpos($req, '/');
       if($pos === false)
           $pos = strlen($req);
       $host = substr($req, 0, $pos);
      
       if(strpos($host, ':') !== false)
       {
           list($this->_host, $this->_port) = explode(':', $host);
       }
       else
       {
           $this->_host = $host;
           $this->_port = ($this->_protocol == 'https') ? 443 : 80;
       }
      
       $this->_uri = substr($req, $pos);
       if($this->_uri == '')
           $this->_uri = '/';
   }

阅读全文