Jump to content

No verification code?


hash1

Recommended Posts

<div class="text">
<h3>Login</h3>
<br>

<a href="register.php">New User Register Free Account</a>
<br>
<a href="recoverpwd.php">Lost password?</a>
<br><br>


<div align="center"><div id="form">
<fieldset>
<legend>Login</legend>

<form name="{5C088896-C4CC-4430-A6D8-9DC9D2BE379D}" action="login.php" method="post">

<table align="center" border="0" width="400">
  <tbody><tr>
    <td align="left" width="150"><p><label>Username</label></p></td>
    <td align="left" width="250"><input size="15" maxlength="25" name="username" autocomplete="off" value="" tabindex="1" type="text"></td>
  </tr>
  <tr>
    <td align="left" width="150"><p><label>Password</label></p></td>

<td align="left" width="250"><input size="15" maxlength="25" name="password" autocomplete="off" value="" tabindex="2" type="password"></td>
  </tr>
  <tr>
    <td align="left" width="150"><p><label>Security Code </label></p></td>
    <td align="left" width="250"><input size="3" maxlength="3" name="code" autocomplete="off" class="securitycode" value="" tabindex="3" type="text"></td>
  </tr>
  <tr>
    <td align="left" width="150"> </td>

    <td align="left" width="250"><img src="image.php?"></td>
  </tr>

  <tr>
    <td align="left" width="150"> </td>
    <td align="right" width="250"><input value="Enter" class="submit" tabindex="4" type="submit">
</td>
  </tr>
</tbody></table>
</form>
</fieldset>

</div></div>





</div>

Link to comment
https://forums.phpfreaks.com/topic/105661-no-verification-code/#findComment-541374
Share on other sites

here is images.php

 

<?php
session_start();

// Juego de letras para usar
$letras = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

// Configuración tamaño imagen y tamaño fuente
$ancho_caja = 130;
$alto_caja = 60;
$tam_letra = 10;
$tam_letra_grande = 45;
// angulo máximo que rota (izq y der) cada letra
$angmax = 20;
// Establecer el tipo de contenido
header("Content-type: image/png");

// Creamos una imagen
$im = imagecreate($ancho_caja, $alto_caja);

// Creo el color del texto, del texto del fondo y del fondo de la imagen
$gris = ImageColorAllocate($im, 247, 247, 247);
$colorLetra = ImageColorAllocate($im, 105, 159, 189);
$colorLetraFondo = ImageColorAllocate($im, 247, 247, 247);


// tipo de letra obtenido en dafont.net
$fuente = './image2.ttf';

// Calculo el número de líneas que entran
$caja_texto = imagettfbbox($tam_letra, 0, $fuente , $letras);
$alto_linea = abs($caja_texto[7]-$caja_texto[1]);
$num_lineas = intval($alto_caja / $alto_linea)+1;

// Dibujo las letras del fondo
// Cada letra de escribe de una en una para poder
// darle una rotación independiente al resto
$pos = 0;
for ($i = 0; $i<$num_lineas; $i++) {
    $x = 0;
    for ($j = 0; $j<30; $j++) {
        $texto_linea = $letras[rand(0, strlen($letras)-1)].' ';
        $caja_texto = imagettfbbox($tam_letra, 0, $fuente , $texto_linea);
    	imagettftext($im, $tam_letra, rand(-$angmax, $angmax), $x, $alto_linea*$i, $colorLetraFondo, $fuente , $texto_linea);
        // Posicion x de la siguiente letra
        $x += $caja_texto[2] - $caja_texto[0];
    }
}


// Escribo las tres letras del CAPTCHA
$res = $letras[rand(0, strlen($letras)-1)];
$ang1 = rand(-$angmax, $angmax);
$caja_texto = imagettfbbox($tam_letra_grande, $ang1, $fuente , $res);
$y1 = abs($caja_texto[7]-$caja_texto[1]);
$x1 = abs($caja_texto[2]-$caja_texto[0]);

$res .= $letras[rand(0, strlen($letras)-1)]; 
$ang2 = rand(-$angmax, $angmax);
$caja_texto = imagettfbbox($tam_letra_grande, $ang2, $fuente , $res[1]);
$y2 = abs($caja_texto[7]-$caja_texto[1]);
$x2 = abs($caja_texto[2]-$caja_texto[0]);

$res .= $letras[rand(0, strlen($letras)-1)];
$ang3 = rand(-$angmax, $angmax); 
$caja_texto = imagettfbbox($tam_letra_grande, $ang3, $fuente , $res[2]);
$y3 = abs($caja_texto[7]-$caja_texto[1]);
$x3 = abs($caja_texto[2]-$caja_texto[0]);

imagettftext($im, $tam_letra_grande, $ang1, ($ancho_caja/2)-(($x1+$x2+$x3)/2), $y1+($alto_caja-$y1)/2, $colorLetra, $fuente , $res[0]);
imagettftext($im, $tam_letra_grande, $ang2, ($ancho_caja/2)-(($x1+$x2+$x3)/2)+($x1), $y2+($alto_caja-$y2)/2, $colorLetra, $fuente , $res[1]);
imagettftext($im, $tam_letra_grande, $ang3, ($ancho_caja/2)-(($x1+$x2+$x3)/2)+($x1+$x2), $y3+($alto_caja-$y3)/2, $colorLetra, $fuente , $res[2]);

imagepng($im);
imagedestroy($im);
imagedestroy($im2);

$_SESSION["texto"] = $res;
?>

Link to comment
https://forums.phpfreaks.com/topic/105661-no-verification-code/#findComment-541377
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.