易截截图软件、单文件、免安装、纯绿色、仅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来 ......

PEAR简介:用PEAR来写你的下一个php程序


PEAR简介:用PEAR来写你的下一个php程序
 
文档选项
打印本页
将此页作为电子邮件发送
级别: 初级
潘凡(Night Sailer) (nightsailer@hotmail.com), 工程师, 北京赛迪数据有限公司
2001 年 6 月 01 日
你可能已经是个PHP的老手了,写了很多非常棒的代码。但是,如果你现在要把它们加入到你现在的项目中去,是 ......

模板引擎 PHP模板引擎【smarty】

[Smarty - 官方网站]
http://smarty.php.net/
[Smarty - 下载地址]
当前版本 2.6.18, http://smarty.php.net/do_download.php?download_file=Smarty-2.6.18.tar.gz

全部列表, http://smarty.php.net/download.php

[Smarty - 相关论坛]
http://php.board.newsmth.net/
http://forum.c ......

php Jpgraph 安装和配置

Jpgraph下载之后,安装非常简单,解压到一个文件夹中,例如:d:\Jpgraph,然后打开php的安装目录,找到php.ini文件,并修改其中的inlude_path参数,并在其后加上Jpgraph的路径,例如:inlude_path=".;d:\Jpgraph".
http://blog.csdn.net/zhuzhao/archive/2009/05/12/4174684.aspx ......

comparing strings in PHP with the == operator

最近在Greg Beaver's的blog上发表的一篇新文章 comparing strings in PHP with the == operator 中提及了PHP的 == 运算符在对字符串进行比较时值得注意的问题。
在某些情况下,PHP会把类数值数据(如含有数字的字符串等)转换成数值处理,== 运算符就是其中之一。在使用 == 运算符对两个字符串进行松散比较时,PHP会把类数 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号