28.04.2007, 13:49:07
also das hier steht in meiner captcha.php
Code:
<?php
include("gb/config.php");
// Auslesen des Sicherheitscodes
$sql = "SELECT `code` FROM $db[captcha]";
$link = mysql_connect($db[host], $db[user], $db[password]) or die ("(captcha.php) Error: ".mysql_error());
mysql_select_db($db[dbname], $link) or die ("(captcha.php) Error: ".mysql_error());
$result = mysql_query($sql, $link) or die ("(captcha.php) Error: ".mysql_error());
for($i=0 ; $i < mysql_num_rows($result); $i++)
{
$sicherheitscode[$i] = mysql_fetch_array($result);
}
for($i=0;$i<1;$i++)
{
$sicherheitscode = $sicherheitscode[$i][code];
}
$captcha = imagecreatefrompng("images/captchabg.png");
// The font "akoom.ttf" used in here is copyrighted by <!-- m --><a class="postlink" href="http://veredgf.fredfarm.com/">http://veredgf.fredfarm.com/</a><!-- m -->.
// It is NOT released under the GNU/GPL. It's Freeware. This means you can use and
// share it for free but you may NOT sell it!
$textwidth = (120 - 100);
$textheight = (40 - 15);
$textcolor = imagecolorallocate($captcha, 95, 95, 95);
imagettftext($captcha, 22, -5, $textwidth, $textheight, $textcolor, "./akoom.ttf", $sicherheitscode);
imagepng($captcha);
?>