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

php 图片验证码

图片验证码的原理是防止恶意注册,实现方法
验证码:<input type="text" name="yanzhengma" />
<iframe src="code/middle.php" height="20px" width="65px" frameborder="0" id="chkimg" scrolling="no" style=" margin-top:5px">
</iframe>
<a  href="javascript:chkimg.location.reload();">看不清,换一张</a>
 
code/middle.php中的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030" />
<title>Insert title here</title>
</head>
<body style="margin:0; padding:0">
  <img src="code.php" />
       
</body>
</html>
 
code.php中的代码:
<?php
/*---------------紫色风铃--------------
*  Info:验证码生产程序;
*  Autore: gb2312
*  Time : 10-1-7 13:10;
*-------------------------------------*/
session_start();
function yanzheng()
{
         $shumu = 4;
         define("shumu","$shumu" );
         $vchar =array( 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z);
         for($i=0; $i<shumu; $i++)
         {
          
            $suiji=$suiji.$vchar[mt_rand(0,61)];
          
         }
         if (strlen($suiji)!=4)
         yanzheng();
     &n


相关文档:

php解析xml示例

<!-- xml 格式
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>

<book id='1002'>
<author>congfeng</author>
<t ......

java和php文件读写对比举例及解决让人头痛的乱码问题

JAVA文件读写必须要注意编码问题 
 java的文件写
直接使用FileWriter即可,第二个参数为追加写入,默认是覆盖写。写完必须close才会保存写好的内容。
默认情况如果没有会新建一个文件
FileWriter fw = null;
try {
fw = new FileWriter("/data/updatetime.dat", true); // true追加写入
fw.append ......

PHP mail Function With Attachments

原帖地址:http://www.zedwood.com/article/126/php-mail-function-with-attachments
This code sends an html formatted email with attachments. This email sending script actually sends both a plaintext and an html body of the email, allowing the email client to choose which to display. The plaintext emai ......

40条技巧优化php代码(PHP100)

1.如果一个方法能被静态,那就声明他为静态的,速度可提高1/4;
2.echo的效率高于print,因为echo没有返回值,print返回一个整型;
3.在循环之前设置循环的最大次数,而非在在循环中;
4.销毁变量去释放内存,特别是大的数组;
5.避免使用像__get, __set, __autoload等魔术方法;
6.requiere_once()比较耗资源;
7.在i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号