This is a simple captcha system for TorrentStrike 0.4F
It is extremely lightweight and it will not slow down the old servers.
- No MySQL need.
- Not storing all the images.
- gif as image format (~=100-120bytes each img)
Preview:
Installation:
1. Copy captcha.php to TorrentStrike 0.4F root.
2. Add this row to the form.
PHP Code:
<tr><td class="rowhead"><img src='captcha.php?ext=.gif' onClick="this.src='captcha.php?ext=.gif';" title="Click to refresh."></td><td class="row1" align="left"><input type="text" size="6" name="captacha" /></td></tr>
3. Add these rows for verification in takelogin / takesignup / recover... for verification.
PHP Code:
require_once("captcha.php");
if(!verifycaptcha($captacha)){
bark("Bad captcha.");
}
PHP Code:
<?php
/* +----------------+
| hon Captcha |
+----------------+
| Simple Captcha |
| Ver: 1.0.00 |
| hon Code 2023 |
| D30-M10-Y2023 |
+----------------+
https://hon-code.blogspot.com/
https://honcode.blogspot.com/
*/
/*======================================+
| Example usage: |
+--------------------------------------+
Firstly place this file on the root path of TorrentStrike 0.4F
Frontend [login]:
=============
<tr><td class="rowhead"><img src='captcha.php?ext=.gif' onClick="this.src='captcha.php?ext=.gif';" title="Click to refresh."></td><td class="row1" align="left"><input type="text" size="6" name="captacha" /></td></tr>
Backend [takelogin] (place it before the username and password checks):
=============
require_once("captcha.php");
if(!verifycaptcha($captacha)){
bark("Bad captcha.");
}
+======================================*/
function mkcaptcha(){
if(session_status() === PHP_SESSION_NONE)
@session_start();
unset($_SESSION['hon_captcha']);
$_SESSION['hon_captcha']=rand(100000,999999);
}
function verifycaptcha($e){
if(session_status()===PHP_SESSION_NONE)
@session_start();
if(intval($_SESSION['hon_captcha'])===intval($e))
return true;
else
return false;
}
if(isset($_GET['ext'])){
if(session_status() === PHP_SESSION_NONE)
session_start();
$hnimg=imagecreate(46,16);
imagecolorallocate($hnimg, rand(0,180), rand(0,180), rand(0,180));
$txtcolor=imagecolorallocate($hnimg,255,255,255);
mkcaptcha();
imagestring($hnimg,3,2,1,$_SESSION['hon_captcha'],$txtcolor);
header("Content-Type: image/gif");
imagegif($hnimg);
imagedestroy($hnimg);
}
?>