易截截图软件、单文件、免安装、纯绿色、仅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和MySQL Web开发》笔记之使用PHP(二)


第五章 代码重用与函数编写
require()或include()可以将一个文件载入到php脚本中。
这两个函数几乎等价,唯一的区别是调用失败后require()给出一个致命错误,而include()只给出一个警告。
如果Web页面具有一致的外观,可以将相同的部分分离到单独的页面中,然后可以在php中使用require()语句将模板元素加入到页面中。 ......

IIS+PHP+MySQL配置 南三方


      在网上找了很多IIS+PHP的配置的方法,试过之后很多都不能达到效果。于是总结了大部分的文章后就得出了这样的方法:(本次操作系统以Win2000为例,如果你要改为其它系统就把系统根目录变一下就Ok了)
一、下载必须的程序:
(1) 先到PHP的官方网站下载一个PHP(本文就以PHP 4.4.2为例)。 ......

用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学习笔记(12):PHP+MYSQL留言板(上

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