易截截图软件、单文件、免安装、纯绿色、仅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
function vCode($num=4,$size=20, $width=0,$height=0){
!$width && $width = $num*$size*4/5+5;
!$height && $height = $size + 10;
// 去掉了 0 1 O l 等
$str = "23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVW";
$code ......

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_screw加密PHP代码

开始之前,首先要澄清两个问题:第一,支持开源,不等于反对代码加密;第二,如果把不属于自己的东西(比如公司的)拿去开源,就更加不应该了。
以前知道的,PHP代码的加密都是用Zend的encoder,这东西不但是商业软件,好像还暴出过能够被破解的问题,所以就找到了替代的方案────php_screw,一个日本人开发的东东。
p ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号