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

php 验证码

checkcode.php
====================
<?php
session_start();
$funcs = array('imagecreatetruecolor','imagecolorallocate','imagefill','imageline','imagedestroy','imagecolorallocatealpha','imageellipse','imagepng');
if(!function_exists('ob_gzhandler'))
    ob_clean();
 //create captcha
 $consts = 'cdfgkmnpqrstwxyz23456';
 $vowels = 'aek23456789';
 for ($x = 0; $x < 6; $x++)
 {
  $const[$x] = substr($consts, mt_rand(0,strlen($consts)-1),1);
  $vow[$x] = substr($vowels, mt_rand(0,strlen($vowels)-1),1);
 }
 $radomstring = $const[0] . $vow[0] .$const[2] . $const[1] . $vow[1] . $const[3] . $vow[3] . $const[4];
        $_SESSION['checkcode'] = $string = substr($radomstring,0,4); //only display 4 str
        //set up image, the first number is the width and the second is the height
 $imageX = strlen($radomstring)*8; //the image width
 $imageY = 20;      //the image height
 $im = imagecreatetruecolor($imageX,$imageY);
 //creates two variables to store color
 $background = imagecolorallocate($im, rand(180, 250), rand(180, 250), rand(180, 250));
 $foregroundArr = array(imagecolorallocate($im, rand(0, 20), rand(0, 20), rand(0, 20)),
         imagecolorallocate($im, rand(0, 20), rand(0, 10), rand(245, 255)),
         imagecolorallocate($im, rand(245, 255), rand(0, 20), rand(0, 10)),
         imagecolorallocate($im, rand(245, 255), rand(0, 20), rand(245, 255)));
 $foreground2 = imagecolorallocatealpha($im, rand(20, 100), rand(20, 100), rand(20, 100),80);
 $middleground = imagecolorallocate($im, rand(200, 160), rand(200, 160), rand(200, 160));
 $middleground2 = imagecolorallocatealpha($im, rand(180, 140), rand(180, 14


相关文档:

PHP源码解析(一)

PHP源代码分析
当前版本PHP5.3.1
目录结构
build 和编译有关的目录。
ext 扩展库代码,例如 Mysql、zlib、iconv 等我们熟悉的扩展库。
main 主目录。
netware
pear
sapi 和各种服务器的接口调用,例如apache、IIS等,也包含一般的fastcgi、cgi等。
scripts Linux 下的脚本目录。
tests 测试脚本目录
TSRM
win32 ......

【转】高级PHP应用程序漏洞审核技术




作者:Ph4nt0m Security Team
来源:http://www.ph4nt0m.org-a.googlepages.com/PSTZine_0x03_0x06.txt
==Ph4nt0m Security Team==

Issue 0x03, Phile #0x06 of 0x07

|=---------------------------------------- ......

用apache_2.2和php 5.2搭建PHP环境

适用于最新的版本PHP-5.2.11和APACHE2.2
下载地址
PHP:http://cn2.php.net/get/php-5.2.11-Win32.zip/from/a/mirror
PHP直接下载http://cn.php.net/distributions/php-5.2.11-Win32.zip
APACHE http://labs.xiaonei.com/apache-mirror/httpd/httpd-2.2.14-win32-src.zip
1、将php解压到C:\php目录下
2、将apache安装 ......

PHP安装步骤(以apache 2 + php5.3为例)

1.     
Download Apache for windows MSI
file, and run it
By
default, port is 80, root dir is %apache_dir%/htdocs. You can update the
settings in conf/httpd.conf file
2.  If Apache Service can't be installed in "Control Panel > Admin Tools > Services&quo ......

PHP加密扩展库Mcrypt安装及应用技巧

PHP程序员们在编写代码程序时,除了要保证代码的高性能之外,还有一点是非常重要的,那就是程序的安全性保障。PHP除了自带的几种加密函数外,还有功能更全面的PHP加密扩展库Mcrypt和Mhash。
其中,Mcrypt扩展库可以实现加密解密功能,就是既能将明文加密,也可以密文还原。
1.PHP加密扩展库Mcrypt安装
在标准的PHP安装过 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号