Captcha(анти спам фильтр)

Статус
В этой теме нельзя размещать новые ответы.
у меня есть более менее хорошее решение
но я не уверен насколько хорошо
вот поссмотрите на пример капчи которое оно генерирует

многие люди говорят, что такую капчу нельзя взломать

если нужна, я могу выложить исходники
там довольно удобно сделано
так что можно прикрутить к любому сайту
 

Вложения

  • jyma.png
    jyma.png
    36,7 KB · Просмотры: 5
Да, если можно залейти исходники на рапиду, а лучше то дайте линку на сайт разработчиков такой каптчи
 
вот писал как то:
PHP:
<?php
class captcha {

	/**
	 * @author Mustafayev Mirza
	 * @version 1.1
	 * 
	 * 	Пример использования
	 * 
	 *	$captcha = new capthca();
	 * 	$captcha->makeimg();
	 * 
	 * несколько шрифтов
	 * 
	 * 	$captcha = new capthca( $font = array('font.ttf','font1.ttf','font2.ttf','font3.ttf','font4.ttf'));
	 * 	$captcha->makeimg();
	 */
	public  $length    = 5;   			// длина строки (int)
	public  $width	   = 204; 			// ширина изображения (int)
	public  $height	   = 60;  			// высота изображения (int)
	public  $size	   = 26;  			// размер шрифта (int)
	private $font      = 'font.ttf'; 	// ttf шрифт
	private $alphabet  = "0123456789abcdefghijklmnopqrstuvwxyz"; 
	private	$allowed_symbols = "23456789abcdeghkmnpqsuvxyz"; 
	private $keystring = array();
	function __construct( $font = false )
	{
		if(!isset($_SESSION))
			session_start();
		if( $font != false && is_file($file) )
		{
			if(is_array($font))
			{
				$rand_keys = array_rand( $font, 1);
				$this->font = $rand_keys[0];	
			}
			else 
			{
				$this->font = $font;	
			}
		}
	}
	function makeimg() {
	
		$image = ''; 
		$image = imagecreatetruecolor ($this->width, $this->height); 

		$bg = imagecolorallocate($image, rand(200,255), rand(200, 255), rand(200, 255));
		$fg = imagecolorallocate($image, rand(0,200), rand(0, 200), rand(0, 200));
		imagefill($image, 0, 0, $bg);
		
		$alphabet_length = strlen($this->alphabet);
		for($i = 0; $i < $this->length; $i++)
		{
			$this->keystring[$i] = $this->allowed_symbols{mt_rand(0,strlen($this->allowed_symbols)-1)};
			ImageTTFText($image, $this->size, rand(-29, 29), (($this->width/$this->length)+$this->size*$i), ($this->height*1.2 - $this->size), imagecolorallocate($image, rand(0,111), rand(0, 111), rand(0, 111)), $this->font, $this->keystring[$i]);
		}
		

		$dc = ImageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
		ImageArc($image, rand(0, $this->width ), rand(0, $this->height ), rand($this->width / 2, $this->width), rand($this->height / 2, $this->height), 0, 360, $dc);

		$dc = ImageColorAllocate($image, rand(0,255), rand(0, 255), rand(0, 255));
		ImageArc($image, rand(0, $this->width ), rand(0, $this->height ), rand($this->width / 3, $this->width), rand($this->height / 2, $this->height), 0, 360, $dc);

		$dots = $this->width * $this->height / 10;
		for ($i=0; $i < $dots; $i++) {
			$dc = ImageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
			ImageSetPixel($image, rand(0, $this->width), rand(0, $this->height), $dc);
		}
		
		header("Content-Type: image/png");
		ImagePNG($image);
		$_SESSION['captcha'] = join("", $this->keystring);
	}
	
}
?>
 
вот писал как то:
PHP:
<?php
class captcha {

	/**
	 * @author Mustafayev Mirza
	 * @version 1.1
	 * 
	 * 	Пример использования
	 * 
	 *	$captcha = new capthca();
	 * 	$captcha->makeimg();
	 * 
	 * несколько шрифтов
	 * 
	 * 	$captcha = new capthca( $font = array('font.ttf','font1.ttf','font2.ttf','font3.ttf','font4.ttf'));
	 * 	$captcha->makeimg();
	 */
	public  $length    = 5;   			// длина строки (int)
	public  $width	   = 204; 			// ширина изображения (int)
	public  $height	   = 60;  			// высота изображения (int)
	public  $size	   = 26;  			// размер шрифта (int)
	private $font      = 'font.ttf'; 	// ttf шрифт
	private $alphabet  = "0123456789abcdefghijklmnopqrstuvwxyz"; 
	private	$allowed_symbols = "23456789abcdeghkmnpqsuvxyz"; 
	private $keystring = array();
	function __construct( $font = false )
	{
		if(!isset($_SESSION))
			session_start();
		if( $font != false && is_file($file) )
		{
			if(is_array($font))
			{
				$rand_keys = array_rand( $font, 1);
				$this->font = $rand_keys[0];	
			}
			else 
			{
				$this->font = $font;	
			}
		}
	}
	function makeimg() {
	
		$image = ''; 
		$image = imagecreatetruecolor ($this->width, $this->height); 

		$bg = imagecolorallocate($image, rand(200,255), rand(200, 255), rand(200, 255));
		$fg = imagecolorallocate($image, rand(0,200), rand(0, 200), rand(0, 200));
		imagefill($image, 0, 0, $bg);
		
		$alphabet_length = strlen($this->alphabet);
		for($i = 0; $i < $this->length; $i++)
		{
			$this->keystring[$i] = $this->allowed_symbols{mt_rand(0,strlen($this->allowed_symbols)-1)};
			ImageTTFText($image, $this->size, rand(-29, 29), (($this->width/$this->length)+$this->size*$i), ($this->height*1.2 - $this->size), imagecolorallocate($image, rand(0,111), rand(0, 111), rand(0, 111)), $this->font, $this->keystring[$i]);
		}
		

		$dc = ImageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
		ImageArc($image, rand(0, $this->width ), rand(0, $this->height ), rand($this->width / 2, $this->width), rand($this->height / 2, $this->height), 0, 360, $dc);

		$dc = ImageColorAllocate($image, rand(0,255), rand(0, 255), rand(0, 255));
		ImageArc($image, rand(0, $this->width ), rand(0, $this->height ), rand($this->width / 3, $this->width), rand($this->height / 2, $this->height), 0, 360, $dc);

		$dots = $this->width * $this->height / 10;
		for ($i=0; $i < $dots; $i++) {
			$dc = ImageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
			ImageSetPixel($image, rand(0, $this->width), rand(0, $this->height), $dc);
		}
		
		header("Content-Type: image/png");
		ImagePNG($image);
		$_SESSION['captcha'] = join("", $this->keystring);
	}
	
}
?>

Глупый вопрос наверно. Куда вставлять этот код, я в php не силен.
 
у меня есть более менее хорошее решение
но я не уверен насколько хорошо
вот поссмотрите на пример капчи которое оно генерирует

многие люди говорят, что такую капчу нельзя взломать

если нужна, я могу выложить исходники
там довольно удобно сделано
так что можно прикрутить к любому сайту

Выложи свои исходники, а то мою доску одолели спам-боты, каждый день приходится вычещать. И если не трудно инструкцию как вставить её в движок или мануал где-то в инете... я тоже в пхп чуть выше нуля :(
 
Два варианта капчи + пример использования от меня



со свой задачей справляються, хотя от ботов спасает не только капча
 
подскажите плиз.
Поставил KCAPTCHA с сайта - captcha. ru-.
Все ок, только под каптчей выводит название сайта? как убрать?
 
В файле kcaptcha_config.php
найди
# show credits
$show_credits = true; # set to false to remove credits line. Credits adds 12 pixels to image height
$credits = 'www.captcha.ru'; # if empty, HTTP_HOST will be shown

true измени на false
 
Где взять такую каптчу как на _http://www.megaupload.com ? Буду очень благодарен
 
А можно-ли изменить в проекте Captcha размер картинки и отображаемый шрифт. И каким образом можно это сделать?
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху