易截截图软件、单文件、免安装、纯绿色、仅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在线编辑器

本范例只能在windows平台下正确运行。编辑器是可以在windows或linux下运行,与平台无关。
配置步骤:
1)webnoteeditor_phpsample文件夹放到网站的目录"webnoteeditor_phpsample"下
2)doc文件夹放到网站目录"doc"下
3)通过 http://localhost/webnoteeditor_phpsample/index.php 来访问
在Windows下,建议使用EasyPHP来 ......

PHP源码解析(一)

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

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 ......

IIS下PHP的ISAPI和FastCGI比较

    原文链接:http://www.williamlong.info/archives/1846.html
    在Windows IIS
6.0下配置PHP
,通常有CGI
、ISAPI
和FastCGI
三种配置方式,这三种模式都可以在IIS
6.0下成功运行,下面我就讲一下这三种方式配置的区别和性能上的差异。
  1、CGI
(通用网关接口/Common Ga ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号