|
J'ai crée un script d'inscription qui se présente ainsi :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a class="lb" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></a>
<html xmlns="<a class="lb" href="http://www.w3.org/1999/xhtml"">http://www.w3.org/1999/xhtml"</a> xml:lang="fr" lang="fr">
<head>
<title>Banniere</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="design_forum" href="css_forum.css" />
</head>
<body>
........... XHTML du forumulaire ....
Une vérification d'inscription a été mis en place afin d'éviter les inscriptions automatiques par les bots par exemple. Vous devez ainsi rentrer le code inscri sur l'image dans la case en dessous. Si vous êtes déficient, veuillez me contactez <strong><a href="mailto:carroteman@gmail.com">en cliquant ici</strong></a><br />
<?php
header('Content-type: image/jpeg');
$image = imagecreate(200, 50);
$fade = imagecolorallocate($image, 211, 217, 0);
$red = imagecolorallocate($image, 173, 33, 75);
$green = imagecolorallocate($image, 90, 139, 78);
$blue = imagecolorallocate($image, 106, 91, 191);
$array = array('d', 8, 6, 'z', 'r', 's', 7, 'p', 1, 'q', 4, 'a', 9, 'o', 1, 'n', 'b', 'v');
imagestring($image, 5, 25, 17, $array[mt_rand(0, 17)], $green);
imagestring($image, 5, 50, 17, $array[mt_rand(0, 17)], $red);
imagestring($image, 5, 105, 17, $array[mt_rand(0, 17)], $blue);
imagestring($image, 5, 140, 17, $array[mt_rand(0, 17)], $green);
imagestring($image, 5, 180, 17, $array[mt_rand(0, 17)], $red);
imagejpeg($image);
?>
</body>
</html>
Bien entendu un message d'erreur puisque je change l'header aprés affichage d'au moin un caractère, comment pourrais-je faire pour afficher limage au lieu de l'erreur? |