Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Torrent Strike
Reply
  #1  
Old 31st October 2023, 02:14
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default Simple Captcha For TorrentStrike 0.4F
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:
Click the image to open in full size.
Click the image to open in full size.

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($hnimgrand(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); 
}
?>
Attached Thumbnails
screencapture-localhost-login-php-2023-10-31-01_19_00.png  
Attached Images
 
Attached Files
File Type: php captcha.php (1.7 KB, 1 views)
__________________
TorrentTrader4Ever

If you want help about TorrentTrader send me a PM.

Last edited by hon; 31st October 2023 at 02:28.
Reply With Quote
The Following 2 Users Say Thank You to hon For This Useful Post:
Fynnon (1st November 2023), Timisoreanul (6th December 2023)
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 11:32. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.