HI @ll!!
Danke für die Hinweise, aber wie es theoretisch funktionieren muss ist mir schon klar, deswegen war mein erster Ansatz auch der nachfolgend aufgeführte, der aber leider auch nicht funktioniert :-(
MFG
Peter
<html>
<head></head>
<body>
<form method="POST" name="test" action="<?php echo $PHP_SELF?>">
<img src="image.jpg">
<input type="text" name="testid">
<input type="submit" name="valid" value="Abschicken">
</form>
</body>
</html>
<?PHP
@session_start ();
if(!isset($_POST['valid']))
{
$vari = strval(rand());
$image = imagecreate(100, 55);
$farbe_body=imagecolorallocate($image,243,243,243);
$farbe_b = imagecolorallocate($image,10,36,106);
imagestring ($image, 5,0, 0, $vari, $farbe_b);
imagejpeg($image,"image.jpg",100);
$_SESSION['vari'] = $vari;
}
if(isset($_POST['valid']))
{ $temp = $_SESSION['vari'];
if($_POST['testid'] == $temp )
echo " gut" ;
else
{
echo " schlechter";
$vari = strval(rand());
$image = imagecreate(100, 55);
$farbe_body=imagecolorallocate($image,243,243,243);
$farbe_b = imagecolorallocate($image,10,36,106);
imagestring ($image, 5,0, 0, $vari, $farbe_b);
imagejpeg($image,"image.jpg",100);
$_SESSION['vari'] = $vari;
}
}
?>