跳至内容
Python 俱乐部
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
php-mysql:captcha
====== PHP验证码程序 ====== 最常用的php验证码程序是[[http://www.phpcaptcha.org/|Securimage PHP Captcha]]. 这个php验证码程序的安装配置和使用都很简单,而且Securimage 验证码程序的文档也比较齐全,是完全开源和免费的。 ===== Securimage验证码程序的下载 ===== 程序下载页面是:http://www.phpcaptcha.org/download/ 最新程序下载地址: http://www.phpcaptcha.org/latest.tar.gz ===== Securimage验证码程序的使用 ===== ==== 测试服务器是否支持Securimage ==== 可以用这个测试页面来测试你的服务器是否支持Securimage验证码程序。 将 [[php-mysql:securimage_test]]测试程序上传到你的服务器。 如果服务器支持Securimage PHP验证码程序,你会看到下面的画面: 本服务器的测试:http://www.pythonclub.org/test/securimage/test_server.php {{http://lh4.ggpht.com/_Tyb1mj7bn04/SllQrnMUFVI/AAAAAAAAAt8/J8jV9BZY2Ko/s400/-test.gif}} ==== 简单的Securimage验证码程序 ==== <code php> <?php session_start(); ?> <?php # created by http://www.pythonclub.org/ ?> <html> <head> <title>Securimage PHP Captcha Test Script</title> </head> <body> <?php if (empty($_POST)) { ?> <form method="POST"> <table border='0'> <tr> <td></td><td><img id="captcha" src="./securimage/securimage_show.php" alt="CAPTCHA Image" /><br/> <a href="#" onclick="document.getElementById('captcha').src = './securimage/securimage_show.php?' + Math.random(); return false">Reload Image</a></td> </tr><tr> <td>Verification Code:</td><td><input type="text" name="captcha_code" size="10" maxlength="6" /></td> </tr> </table> <input type="submit" value="Submit Form" /> </form> <?php } else { //form is posted $code = trim($_POST['captcha_code']); include_once("./securimage/securimage.php"); $img = new Securimage(); $valid = $img->check($code); if($valid == true) { echo "php验证码程序验证成功"; } else { echo "php验证码程序验证失败"; } } ?> </body> </html> </code> 其中第一行的 %%<?php session_start(); ?>%%是执行验证码程序必须的。 php验证码测试页面: http://www.pythonclub.org/test/securimage/test_form.php
php-mysql/captcha.txt
· 最后更改: 2010/06/02 01:18 (外部编辑)
页面工具
显示页面
修订记录
反向链接
回到顶部