<?php
// Récupération des valeurs du formulaires
$nom = $_POST['nom'];
$email = $_POST['email'];
$message = $_POST['message'];
// déclaration des variables pour pouvoir les utiliser par la suite
$url = '';
$erreur = 'non';
// Si nous n'avons pas de nom
if ( empty($nom) ) {
$erreur = 'oui';
$url .= '&nom=oui';
}
// Si nous n'avons pas d'email
if ( empty($email) ) {
$erreur = 'oui';
$url .= '&email=oui';
}
// Si nous n'avons pas de message
if ( empty($message) ) {
$erreur = 'oui';
$url .= '&message=oui';
}
// Et maintenant, avons-nous rencontré une erreur ?
if ( $erreur == 'oui' ) {
// Redirection
header('location: index.php?erreur=oui'.$url);
// Et arret du script
exit();
}
$adresse_dest = "[email protected]";
$sujet = "Client SoGames";
$contenue_message = "Nom client : " . $nom ."\n" .
"Email client : " . $email . "\n" .
"Message du client :\n" . $message. "\n";
$adresse_exp = "From: [email protected]";
$succes = mail($adresse_dest, $sujet, $contenue_message, $adresse_exp);
?>
<html>
<head>
<title>message envoyé</title>
</head>
<body>
<?php
if ($succes)
echo "message envoyé";
else
echo "erreur lors de l'envoi";
?>
<p>merci de votre message</p>
</body>
</html>// déclaration des variables pour pouvoir les utiliser par la suite
$url = '';
$erreur = 'non';
<?php
if ($succes)
echo "message envoyé";
else
echo "erreur lors de l'envoi";
?>
c'est ceci qui a fait de-beug le script?<?php
session_start();
if (!empty($_POST['captcha'])) {
if($_POST['captcha'] == $_POST['captcha']) {
$resultat = '<p>Merci De Votre Message!</p>';
} else {
$resultat = '<p>Code incorrect!</p>';
}
} else {
$resultat = '<p>veuillez entré le code ci dessou!</p>';
}
$_POST['captcha'] = substr(substr(md5(rand(0.10000).time()),0,6);
?>
<?php echo $resultat; ?>
<form action="captcha.php" method="post">
<img src="captcha.php"> <imput type="text" name="captcha" value=""><br/>
<input type="submit" value="go" />
</form>
<?php
header(*Content-Type: images/png*);
session_start();
$im = imagecreate(100, 40);
$white = imagecolorallocate($im, 255, 255. 255);
$black = imagecolorallocate($im, 0, 0. 0);
imagefill($im, 0, 0, $whilte);
if (!empty($_POST['captcha'])) {
for($i = 0; $i < strlen($_POST['captcha']); $i++) {
$r = rand(0.255);
$g = rand(0.255);
$b = sqrt(100 * 100 - $r * $r * - $g * $g);
$couleur = imagecolorallcate($im, $r ,$g,$b);
imagechar($im, rand(0,4), 0 + 10 * $i + rand(0,5), rand(0.10) .
$_POST['captcha'][$i], $couleur);
}
}
image($im);
imagedestroy($im);
?>
voila merci de votre aide
<!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>
<!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