易截截图软件、单文件、免安装、纯绿色、仅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应用程序漏洞审核技术




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

Issue 0x03, Phile #0x06 of 0x07

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

php学习笔记(10):MYSQL数据库中的常用SQL语句

MYSQL数据库中的常用SQL语句
1、SELECT 查询语句和条件语句
SELECT  查询字段 from 表名 WHERE 条件 
查询字段:可以使用通配符* 、字段名、字段别名
表名: 数据库.表名 ,表名
常用条件: = 等于 、<>不等于、in 包含 、&nb ......

[转]细察 PHP V5.3.0 特性


细察 PHP V5.3.0 特性
级别: 中级
Stephen B. Morris, CTO, Omey Communications
2009 年 12 月 07 日
随着流行的 PHP 语言的不断演变,很多新特性使它在面向对象方面有了进一步的增强。本文通过一些 PHP V5.3 实例演示延迟静态绑定、名称空间支持、类方法重载以及变量解析和 heredoc 支持。
需求
除了对 PHP 和 H ......

php学习笔记(12):PHP+MYSQL留言板(上

require()  与  require_once()
    
      通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require
所指定引入的文件,如果出现错误是致命的。
nclude()  与  include_once()
    
    &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号