par
aurel08 » 05 sept. 2010, 22:24
pour mon ancien probleme non il en a plus et la pour mon captcha j'ai aucune lettre qui saffiche pour recopié re voici mes code car j'ai corigé des erreur :
index1.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-scrict.dtd">
<html xml:lang="fr" xmlns="http://www.3.org/1999/xhtml">
<?php
session_start();
if (!empty($_POST['captcha'])) {
if ($_POST['captcha'] == $_SESSION['captcha']) {
$resultat = '<p>Merci De Votre Message!</p>';
} else {
$resultat = '<p>Code incorrect!</p>';
}
} else {
$resultat = '<p>veuillez entré le code ci dessou!</p>';
}
$_SESSION['captcha'] = substr(md5(rand(0.10000).time()),0,6);
?><html>
<head>
<body>
<?php echo $resultat; ?>
<form action="index1.php" method="post">
<img src="captcha.php"><input type="text" name="captcha" value=""><br/>
<input type="submit" value="go" />
</form>
et captcha.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-scrict.dtd">
<html xml:lang="fr" xmlns="http://www.3.org/1999/xhtml">
<?php
header(*Content-Type: image/png*);
session_start();
$im = imagecreate(100, 40);
$white = imagecolorallocate($im, 255, 255. 255);
$black = imagecolorallocate($im, 0, 0. 0);
imagettftext($im, rand(13, 25), rand(-30, 30), 0 + 20 * $i + rand(0, 5), 20 + rand(0,10) , $couleur, './WAVY.TTF',
$SESSION['captcha'][$i]);
imagefill($im, 0, 0, $white);
if (!empty($_SESSION['captcha'])) {
for($i = 0; $i < strlen($_SESSION['captcha']); $i++) {
$r = rand(0.255);
$g = rand(0.255);
$b = sqrt(100 * 100 - $r * $r - $g * $g);
$couleur = imagecolorallocate($im, $r ,$g,$b);
imagechar($im, rand(0,4), 0 + 10 * $i + rand(0,5), rand(0,10) ,
$_SESSION['captcha'][$i], $couleur);
}
}
imagepng($im);
imagedestroy($im);
?>
voila la j'ai corriger des erreur mes aucune code s'affiche voic le lien pour que vous voyez pas vous meme :
http://php.sogames-prod.com/index1.php
j'etait sur un autre site pour demandé de l'aide vraiment de la m**rde on reçois plus de reflection que de l'aide jamais vu sa heuresement que php france est la serieux merci encore de votre aide.
pour mon ancien probleme non il en a plus et la pour mon captcha j'ai aucune lettre qui saffiche pour recopié re voici mes code car j'ai corigé des erreur :
index1.php
[php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-scrict.dtd">
<html xml:lang="fr" xmlns="http://www.3.org/1999/xhtml">
<?php
session_start();
if (!empty($_POST['captcha'])) {
if ($_POST['captcha'] == $_SESSION['captcha']) {
$resultat = '<p>Merci De Votre Message!</p>';
} else {
$resultat = '<p>Code incorrect!</p>';
}
} else {
$resultat = '<p>veuillez entré le code ci dessou!</p>';
}
$_SESSION['captcha'] = substr(md5(rand(0.10000).time()),0,6);
?><html>
<head>
<body>
<?php echo $resultat; ?>
<form action="index1.php" method="post">
<img src="captcha.php"><input type="text" name="captcha" value=""><br/>
<input type="submit" value="go" />
</form>[/php]
et captcha.php
[php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-scrict.dtd">
<html xml:lang="fr" xmlns="http://www.3.org/1999/xhtml">
<?php
header(*Content-Type: image/png*);
session_start();
$im = imagecreate(100, 40);
$white = imagecolorallocate($im, 255, 255. 255);
$black = imagecolorallocate($im, 0, 0. 0);
imagettftext($im, rand(13, 25), rand(-30, 30), 0 + 20 * $i + rand(0, 5), 20 + rand(0,10) , $couleur, './WAVY.TTF',
$SESSION['captcha'][$i]);
imagefill($im, 0, 0, $white);
if (!empty($_SESSION['captcha'])) {
for($i = 0; $i < strlen($_SESSION['captcha']); $i++) {
$r = rand(0.255);
$g = rand(0.255);
$b = sqrt(100 * 100 - $r * $r - $g * $g);
$couleur = imagecolorallocate($im, $r ,$g,$b);
imagechar($im, rand(0,4), 0 + 10 * $i + rand(0,5), rand(0,10) ,
$_SESSION['captcha'][$i], $couleur);
}
}
imagepng($im);
imagedestroy($im);
?>
[/php]
voila la j'ai corriger des erreur mes aucune code s'affiche voic le lien pour que vous voyez pas vous meme : http://php.sogames-prod.com/index1.php
j'etait sur un autre site pour demandé de l'aide vraiment de la m**rde on reçois plus de reflection que de l'aide jamais vu sa heuresement que php france est la serieux merci encore de votre aide.