易截截图软件、单文件、免安装、纯绿色、仅160KB

完整的PHP图形验证码程序源码!


代码如下:
<?php
   /*   网站验证码程序
    *   运行环境: PHP5.0.18 下调试通过
    *   需要 gd2 图形库支持(PHP.INI中 php_gd2.dll开启)
    *   文件名: showimg.php
    *   作者:  17php.com
    *   Date:   2007.03
    *   技术支持: www.17php.com
    */
   //随机生成一个4位数的数字验证码
    $num="";
    for($i=0;$i<4;$i++){
    $num .= rand(0,9);
    }
   //4位验证码也可以用rand(1000,9999)直接生成
   //将生成的验证码写入session,备验证页面使用
    Session_start();
    $_SESSION["Checknum"] = $num;
   //创建图片,定义颜色值
    Header("Content-type: image/PNG");
    srand((double)microtime()*1000000);
    $im = imagecreate(60,20);
    $black = ImageColorAllocate($im, 0,0,0);
    $gray = ImageColorAllocate($im, 200,200,200);
    imagefill($im,0,0,$gray);
    //随机绘制两条虚线,起干扰作用
    $style = array($black, $black, $black, $black, $black, $gray, $gray, $gray, $gray, $gray);
    imagesetstyle($im, $style);
    $y1=rand(0,20);
    $y2=rand(0,20);
    $y3=rand(0,20);
    $y4=rand(0,20);
    imageline($im,


相关文档:

how to install apache, PHP and MySQL on Linux 2

how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......

php单引号和双引号的区别

本文转自http://xfs39.javaeye.com/blog/411508 感谢作者分享
php单引号和双引号的区别



    今天,有一新学PHP的网友问了茶农一个问题:“单引号和双引号的区别和用法?”,现将答案总结了下,写成这篇小短文。
" "双引号里面的字段会经过编译器 ......

php 字符串、文件转化成二进制流文件

$file1 = 'F:/46.gif';
$file2 = 'F:/test.txt';
$file3 = 'F:/47.gif';
$size = filesize($file1);
echo '文件大小为:'.$size;
echo "\n<br>转化为二进制 ...";
$content = file_get_contents($file1);
$content = bstr2bin($content);
$fp = fopen($file2, 'w');
fwrite($fp, $content);
fclose($fp);
......

一个php分页设计

www.diybl.com 时间:2008-06-01 作者:佚名
将其保存成一个文件,用时调用
<?
//为了避免重复包含文件而造成错误,加了判断函数是否存在的条件:
if(!function_exists(pageft)){
//定义函数pageft(),三个参数的含义为:
//$totle:信息总数;
//$displaypg:每页显示信息数,这里设置为默认是20;
//$url:分 ......

MySQL+PHP乱码原理与解决

本文从 http://tech.ddvip.com/2009-02/1235627800109815.html 装载,非常感谢作者!
MySQL+PHP产生乱码原因:
  ◆ MySQL数据库默认的编码是utf8,如果这种编码与你的PHP网页不一致,可能就会造成MySQL乱码;
  ◆ MySQL中创建表时会让你选择一种编码,如果这种编码与你的网页编码不一致,也可能造成MySQL乱码;
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号