Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÎÒµÄphpÑéÖ¤ÂëÀà


<?php
/*
 * Created on 2010-3-11
 * author:zhangfei
 *ÎÒµÄÑéÖ¤ÂëÀà
 */
 session_start();
 class Check_Class{
  public $h_img ;
public $c_back ;
public $c_front ;
//¹¹Ô캯Êý
function Check_Class(){
$h_img  =  imagecreate(100,30);
$c_back  =  imagecolorallocate($h_img,0,0,0);
$c_front  =  imagecolorallocate($h_img,255,255,255);
$_SESSION[randstr]=$randm_string = $this->random(5);//ÓÃsession±£´æÆðÀ´ÓÃÒÔºóÃæÅжÏ
$this->getLine($h_img);
$this->getPoint($h_img);
$this->paintString($h_img,$randm_string,$c_front);
//ÏÔʾͼƬ
header("Content-type:  image/jpeg");
imagejpeg($h_img);
imagedestroy($h_img);
}
  //²úÉúËæ»ú×Ö·û´®£¬°üÀ¨Êý×ֺʹóСд×Öĸ
  function random($length)
{
   $hash = "";
   $chars = "CEFGHIJKLMNOPQRSTUVWXYZ0123456789cefghijklmnopqrstuvwxyz";
   $max = strlen($chars) - 1;
   mt_srand((double)microtime() * 1000000);
   for($i = 0; $i < $length; $i++)
   {
       $hash .= $chars[mt_rand(0, $max)];
   }
   return $hash;
}
//»­¸ÉÈÅÏߵĺ¯Êý
function getLine($h){
for($j=0;$j<5;$j++){
//¶¨ÒåÏßÌõ
$c_line = imagecolorallocate($h,rand(0,255),rand(0,255),rand(0,255));
//ÔÚͼƬÉÏ»®Ïß
imageline($h,rand(0,100),rand(0,30),rand(0,100),rand(0,30),$c_line);
}
}
//»­Ôëµã
function getPoint($h){
for($ii=0;$ii<400;$ii++){
$c_point = imagecolorallocate($h,rand(0,255),rand(0,255),rand(0,255));//¶¨ÒåÔëµãÑÕÉ«
imagesetpixel($h,rand()%100,rand()%30,$c_point);
}
}
//»­×Ö·û´®
function paintString($h,$rd_str,$c_f){
imagestring($h,rand(4,6),rand(1,50),rand(1,15),$rd_str,$c_f);
}
 }
 $chek = new Check_Class();
?>


Ïà¹ØÎĵµ£º

php×ÔÓÃÊý¾Ý»º´æÀà

¸Õ»»ÁËÒ»¸ö¹¤×÷£¬ÏÖÔÚûʲôÊÂ×ö£¬Ð´ÁËÒ»¸öÊý¾Ý»º´æµÄÀà¡£
¿ÉÒÔ»º´æÊý×飬×Ö·û£¬¶ÔÏóµÈ£¬Ö´ÐÐЧÂÊ»¹Ã»ÓвâÊÔ£¬ÏȷųöÀ´°É¡£
ʵÀýÈçÏ£º
 * @example
 * require 'MyCache.class.php';
 * $mc = new MyCache("./test/cache");
 * $a = "hello world111";
 * $mc->set("ss", $a);
  ......

PHP µÄ´íÎ󱨸æ

PHP µÄ´íÎ󱨸æ
display_errors = Off
error_reporting = E_ALL
display_errors  ÊÇ·ñÏÔʾ´íÎó¡£Ä¬ÈÏÖµÊÇ Off¡£ÒªÈÿª·¢¹ý³Ì¸ü¼ÓÇáËÉ£¬Çë°ÑÕâ¸öÖµÉèΪ On£º
display_errors = On
error_reporting ±äÁ¿µÄĬÈÏÖµÊÇ E_ALL¡£Õâ¸öÉèÖûáÏÔʾ´Ó²»Á¼±àÂëʵ¼ùµ½ÎÞº¦Ìáʾµ½³ö´íµÄËùÓÐÐÅÏ¢¡£E_ALL ¶ÔÓÚ¿ª·¢¹ý³ÌÀ´ËµÓеã̫ϸ ......

Ç¿´óµÄPHPαÔìIPÍ·¡¢Cookies¡¢Reference¡­¡­

<?
$fp = fsockopen ("passport.baidu.com", 80,
$errno, $errstr, 30);
if (!$fp) {
echo "$errstr
($errno)<br>\n";
} else {
$msg="GET
/?login&username=lapiaotuan22&password=oyhz123456
HTTP/1.0\r\n";
$msg.="Host:passport.baidu.com \r\n&quo ......

PHPµÄÒ»¸ö¹ýÂËÃô¸Ð´Ê»òÔà»°µÄ·½·¨

Ö÷ҪʹÓÃÁË  int substr_count ( string haystack, string needle [, int offset [, int length]] )  Õâ¸ö·½·¨,Õâ¸ö·½·¨±éÀú´ý²âµÄ×Ö·û´®$strÖÐÓÐûÓÐ$allergicWordÊý×éÖÐËù°üº¬µÄÃô¸Ð´Ê£º
      $allergicWord = array('Ôà»°','ÂîÈË»°');
      $str = 'Õâ ......

¼èÄѵľñÔñ£ºPHPÓëASPµÄ×ۺϱȽÏ

ʲôÊÇPHP
¡¡¡¡PHP´ú±íÁË"³¬Îı¾´¦ÀíÆ÷"£¬ÕâÒâζ×ÅÄã±ØÐëÖªµÀ£¬ËüÊÇÒ»ÖÖ·þÎñÆ÷¶ËµÄ´¦ÀíÓïÑÔ£¬ÇÒÒÔHTMLµÄÐÎʽ³öÏÖ¡£Ëü×î³£Óõĵط½¾ÍÊÇÍøÒ³ÁË£¬Êý¾Ý´Ó¿Í»§»ú·¢Ë͵½Web·þÎñÆ÷£¬ÐÅÏ¢Ôڴ˱»´¦Àí²¢·µ»Ø½á¹û¡£
¡¡¡¡µ«ÕâÖÖͨÓÃÐÔµÄÓïÑÔË¿ºÁ²»¾ÖÏÞÓÚÔÚÍøÒ³·½Ã棬PHPÒ²Äܱ»ÓÃÔÚÃüÁîÐÐshellÖУ¬Ëü¿É×÷Ϊ²Ù×÷ϵͳµÄÒ»¸öÀ©Õ¹£¬ÓÉ´ËÖ´Ð ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ