Commit 3b0bbbc8 authored by Cellophile's avatar Cellophile 🎨
Browse files

Replace captcha.php

parent 3fc2767e
<?php
session_start();
$_SESSION['captcha'] = mt_rand(1000,99999);
$img = imagecreate(85,28);
$font = 'fonts/28DaysLater.ttf';
for ($s = '', $i = 0, $z = strlen($a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')-1; $i != 5; $x = rand(0,$z), $s .= $a{$x}, $i++);
$_SESSION['captcha'] = $s;
$img = imagecreate(130,50);
$input = array ("fonts/28DaysLater.ttf", "fonts/Allrightsreserved.ttf", "fonts/BrokenGlass.ttf", "fonts/NewspaperCutoutWhiteOnBlac-Rg.ttf");
$choixfont = array_rand ($input, 2);
$font = $input[$choixfont[0]];
$colorbackground = imagecolorallocate($img, 255,255,255);
$textcolor = imagecolorallocate($img, 0,0,0);
imagettftext($img, 23, 0, 6, 30, $textcolor, $font, $_SESSION['captcha']);
imagettftext($img, 30, 0, 10, 40, $textcolor, $font, $_SESSION['captcha']);
header('content-type:image/jpeg');
imagejpeg($img);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment