Enregistrement formulaire MySQL & envois mail PHP

Signaler
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013
-
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013
-
Bonjour à tous,

pour faire court... je suis novice et je me démerde avec ce que je trouve sur le web , j'ai un formulaire qui fonctionne ( s'enregistre sur DB Mysql ) les check se font.. tout est top... enfin je pense. sur une autre page... j'ai un autre type de formulaire qui ne s'enregistre pas en DB mais est envoyer par email ( à 3 destinataire ). là aussi j'ai trouvé le moyen de faire fonctionner ceci.... maintenant j'ai besoin de faire un merge des 2 formulaire... ( c'est à dire.. Qu'il enregistre les data sur base de donnée, puis et simultanément ( dans le même clique de souris ) puisse être envoyé à 3 destinataires............ malgré que j'ai les 2 formulaires séparément qui fonctionne... je n'arrive pas à en faire qu'un seul qui fasse que le tout fonctionne. ( j'ai merger les lignes de codes... et ci-dessous le formulaire )

si une âme généreuse aurait la bonne volonté de voir où est mon problème... je serai ravi. je suis certains que cela est certainement tout simple.. mais pour moi cela reste encore un peu chinois..pour ne pas dire compliqué.

seconde autre requêtes.. dans la foulée si cela ets possible... Je ne sais pas comment mettre un check ( vérification ) si une info existe dans la base :
c'est à dire.. que je demande à celui qui s'enregistre d'indiquer l'adresse email de son sponsor ( comment puis-je effectuer cette action lorsqu'il tape l'adresse email dans le champs ? ( c'est à dire qu'il devrait y avoir un check si cette adresse est existante ou pas. si oui le formulaire peut s'envoyer.. si non on lui indique directement que cette adresse n'existe pas dans notre base. )... si vous savez faire ca... c'est génial.

si besoin ( en contrepartie je me démerde assez bien avec photoshop, et je peux vous réaliser des truc graphiques ) service contre service, dans un monde d'échange :o)

voici ci dessous mon form que j'ai raccourci pour ne pas mettre des lignes inutiles.

<?php
session_start();
/*ici le session_start();*/
$err = null; /*au depart*/

//echo '<pre>';
//print_r($_POST);
//echo '</pre>';

// on teste si le visiteur a soumis le formulaire
if (isset($_POST['inscription']) && $_POST['inscription'] == 'Registration') {

/*petit filtre pas du luxe */
foreach($_POST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_POST[$k]=$v;
}

foreach($_GET as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_GET[$k]=$v;
}

foreach($_REQUEST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_REQUEST[$k]=$v;
}
/*fin filtre*/

function conn(){
mysql_connect('localhost', 'user', 'password');
mysql_select_db('mydb');
}

// Vérification 1er email
function checkmail($mail){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email'])){
return true;
}else{
return false;
}
}

// Vérification 2ème email
function checkmail2($mail2){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email_sponsor'])){
return true;
}else{
return false;
}
}

function ismembre($login){
conn();
$log=mysql_real_escape_string($login);
// on recherche si ce login est déjà utilisé par un autre membre
$sql = "SELECT id FROM member WHERE login='".$log."' limit 1";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

if(mysql_fetch_row($req)===1){
return true;
}else{
return false;
}

mysql_close();
}


/*les tests*/

// on teste l'existence de nos variables. On teste également si elles ne sont pas vides
if(isset($_POST['login']) && !empty($_POST['login'])) { } else {$err.='<br>The Login is empty';}
if(isset($_POST['pass']) && !empty($_POST['pass'])) { } else {$err.='<br>The password is empty';}
if(isset($_POST['pass_confirm']) && !empty($_POST['pass_confirm'])) { } else {$err.='<br>the two passwords are different';}
if (isset($_POST['pass'],$_POST['pass_confirm']) && $_POST['pass'] === $_POST['pass_confirm']) { } else {$err.='<br>the two passwords are different';}


if(isset($_POST['email']) && !empty($_POST['email'])) {

if(checkmail($_POST['email'])===true) {
}else{
$err.='<br>Your email address is not valid';
}

}else {$err.='<br>Your email address is not valid';}


if(isset($_POST['email_sponsor']) && !empty($_POST['email_sponsor'])) {

if(checkmail2($_POST['email_sponsor'])===true) {
}else{
$err.='<br>The email address of your sponsor is not valid';
}

}else {$err.='<br>The email address of your sponsor is not valid';}

if(isset($_POST['sponsor']) && !empty($_POST['sponsor'])) { } else {$err.='<br>Sponsor is empty';}
if(isset($_POST['dream']) && !empty($_POST['dream'])) { } else {$err.='<br>Your Dream is empty !';}
if(isset($_POST['name']) && !empty($_POST['name'])) { } else {$err.='<br>Your Name is empty !';}
if(isset($_POST['lastname']) && !empty($_POST['lastname'])) { } else {$err.='<br>Your Lastname is empty !';}
if(isset($_POST['birth_day']) && !empty($_POST['birth_day'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_month']) && !empty($_POST['birth_month'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_year']) && !empty($_POST['birth_year'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['terms']) && !empty($_POST['terms'])) { } else {$err.='<br>Please Agree The Terms and Conditions';}

if(isset($_POST['login']) && strlen($_POST['login'])>2 && ismembre($_POST['login'])===false) {
}else{
$err.='<br>This login is already used by another member';
}

if(isset($_POST['security_code']) && !empty($_POST['security_code'])) { } else {$err.='<br>The captcha is empty !';}

if(($_SESSION['security_code'] === $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {

// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
unset($_SESSION['security_code']);

} else {
$err.='<br>The captcha was wrong<br>Please fill in all the required fields*';
}
// on teste si le visiteur a soumis le formulaire
if (empty($err) && isset($_POST['inscription']) && $_POST['inscription'] === 'Registration') {
//on insere les données en base et on redirige
conn();
$sql = 'INSERT INTO member VALUES("", "'.mysql_escape_string($_POST['login']).'", "'.mysql_escape_string(md5($_POST['pass'])).'", "'.mysql_escape_string($_POST['type']).'", "'.mysql_escape_string($_POST['name']).'", "'.mysql_escape_string($_POST['lastname']).'", "'.mysql_escape_string($_POST['birth_day']).'", "'.mysql_escape_string($_POST['birth_month']).'", "'.mysql_escape_string($_POST['birth_year']).'", "'.mysql_escape_string($_POST['address1']).'", "'.mysql_escape_string($_POST['address2']).'", "'.mysql_escape_string($_POST['job']).'", "'.mysql_escape_string($_POST['zipcode']).'", "'.mysql_escape_string($_POST['city']).'", "'.mysql_escape_string($_POST['state']).'", "'.mysql_escape_string($_POST['country']).'", "'.mysql_escape_string($_POST['email']).'", "'.mysql_escape_string($_POST['phone']).'", "'.mysql_escape_string($_POST['skype']).'", "'.mysql_escape_string($_POST['sponsor']).'", "'.mysql_escape_string($_POST['email_sponsor']).'", "'.mysql_escape_string($_POST['dream']).'", "'.mysql_escape_string($_POST['dream_price']).'", "'.mysql_escape_string($_POST['comment']).'", "'.mysql_escape_string($_POST['newsletter']).'", "'.mysql_escape_string($_POST['terms']).'", NOW())';
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
mysql_close();
$_SESSION['login'] = $_POST['login'];
header('Location: member.php');

//On récupère les valeurs du formulaire

if (get_magic_quotes_gpc())
{
$sponsor = stripslashes($_POST['sponsor']);
$login = stripslashes($_POST['login']);
$pass = stripslashes($_POST['pass']);
$email_sponsor = stripslashes($_POST['email_sponsor']);
$type = stripslashes($_POST['type']);
$name = stripslashes($_POST['name']);
$lastname = stripslashes($_POST['lastname']);
$birth_day = stripslashes($_POST['birth_day']);
$birth_month = stripslashes($_POST['birth_month']);
$birth_year = stripslashes($_POST['birth_year']);
$job = stripslashes($_POST['job']);
$address1 = stripslashes($_POST['address1']);
$address2 = stripslashes($_POST['address2']);
$zipcode = stripslashes($_POST['zipcode']);
$city = stripslashes($_POST['city']);
$state = stripslashes($_POST['state']);
$country = stripslashes($_POST['country']);
$phone = stripslashes($_POST['phone']);
$skype = stripslashes($_POST['skype']);
$email = stripslashes($_POST['email']);
$comment = stripslashes($_POST['comment']);
$terms = stripslashes($_POST['terms']);
}
else
{
$sponsor = $_POST['sponsor'];
$login = $_POST['login'];
$pass = $_POST['pass'];
$email_sponsor = $_POST['email_sponsor'];
$type = $_POST['type'];
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$birth_day = $_POST['birth_day'];
$birth_month = $_POST['birth_month'];
$birth_year = $_POST['birth_year'];
$job = $_POST['job'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$zipcode = $_POST['zipcode'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$skype = $_POST['skype'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$terms = $_POST['terms'];
}

//On crée le message email


// clé aléatoire de limite
$boundary = md5(uniqid(microtime(), TRUE));

// Headers
$headers = 'From: de moi <info@monfournisseur.com>'."\r\n";
$headers .= 'Mime-Version: 1.0'."\r\n";
$headers .= 'Content-Type: multipart/mixed;boundary='.$boundary."\r\n";
$headers .= "\r\n";

// Message 1 (TEXT)
$msg1 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg1 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg1 .= 'Compte user: '.$login."\r\n";
$msg1 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg1 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg1 .= 'State: '.$state."\r\n";
$msg1 .= 'Country: '.$country."\r\n\r\n";
$msg1 .= 'Email: '.$email."\r\n\r\n";
$msg1 .= 'blabla bla et re bla bla'."\r\n";
$msg1 .= 'Good day.'."\r\n\r\n";
$msg1 .= 'moi'."\r\n\r\n";

// Message 2 (TEXT)
$msg2 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg2 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg2 .= 'Compte user: '.$login."\r\n";
$msg2 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg2 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg2 .= 'State: '.$state."\r\n";
$msg2 .= 'Country: '.$country."\r\n\r\n";
$msg2 .= 'Email: '.$email."\r\n\r\n";
$msg2 .= 'blabla bla et re bla bla'."\r\n";
$msg2 .= 'Good day.'."\r\n\r\n";
$msg2 .= 'moi'."\r\n\r\n";

// Message 3 (HTML) le code HTML a été radicalement raccourci (pour éviter de prendre trop de place sur le forum)

$msg3 = '--'.$boundary."\r\n";
$msg3 .= 'Content-type: text/html; charset=iso-8859-1'."\r\n\r\n";
$msg3 .= '<div><table width="1024" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<font size="2" style="color:#051c54; font-family: Arial, Helvetica, sans-serif;">Bla bla et rebla bla.</font><br>
</td>
</tr>
</table>
</div>'."\r\n";

// Information au 1 destinataire
$recipient = "$email_sponsor"; //envois mail (TEXT)
$subject = "sujet 1"; //Sujet du mail(
mail($recipient, $subject, $msg1, $mailheaders); //Confirmation mail envoyé

// Information au 2ème destinataire
$recipient2 = "$email"; //envois mail
$subject2 = 'sujet 2 '; //Sujet du mail
mail($recipient2, $subject2, $msg2, $headers); //Confirmation mail envoyé )

// Information au 3ème destinataire
$recipient3 = "registration@monfournisseur.com"; //envois mail
$subject3 = "sujet 3"; //Sujet du mail
mail($recipient3, $subject3, $msg3, $headers); //Confirmation mail envoyé

$mailheaders = "From: monfournisseur.com<> \n"; //Depuis où le mail à été posté

exit;
}
}
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Registration</title>
<link rel="stylesheet" type="text/css" href="slide/engine1/style.css" />
<script src="/common/monfile.js" type="text/javascript"></script>
<link href="common/monfile.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="slide/engine1/jquery.js"></script>
<script language="JavaScript" type="text/javascript"></script>
<style type="text/css">
body {
background-image: url(/images/bg/bg_9.jpg);
overflow: hidden;
background-repeat: repeat;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
<script language="JavaScript">
<!--
function ucfirst(chaine){
if(chaine.length == 1){
return chaine.toUpperCase();
}
else if(chaine.length >= 1){
return chaine.substring(0,1).toUpperCase()+chaine.substring(1,chaine.length).toLowerCase();
}
else{
return "";
}
}
-->
</script>

</head>
<body style="background-color:#ffffff" oncontextmenu="return copyright()">
<form action="registration.php" method="post" name="inscription" enctype="multipart/form-data">
<table width="100%" height="80" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" height="80" valign="bottom">J'ai shouter tous les champs et raccourci <br>le code du body pour facilité le post sur le forum. <br><br>
<input type="submit" name="inscription" value="Registration" style="cursor:pointer;" tabindex="31" title="I valid my registration"></td>
</tr>
</table></form>
</body>
</html>

merci pour tous ceux qui prendront le temps pour m'aider..


Deep

7 réponses

Messages postés
31488
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
25 février 2021
344
Bonsoir.
Perso, du code posté sur le forum sans les balises de code...je ne le lis pas.. :-(

Pour ce qui est de ta verif du sponsor, passe par du javascript (ajax) si tu souhaites la faire lors de la saisie.
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013

hello Jordane,
ok donc si je comprends tu aurai besoin du code complet avec les champs txt.. je peux bien evidement mettre cela... c'était pour éviter une page archi longue..... concernant l'ajax... j'en ai entendu parlé..mais jamais touché.. donc cela reste inconnu pour moi.
dis moi si tu es ok de voir cela ?
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013

voici.. le code complet du formulaire..

<?php
session_start();
/*ici le session_start();*/
$err = null; /*au depart*/

//echo '<pre>';
//print_r($_POST);
//echo '</pre>';

// on teste si le visiteur a soumis le formulaire
if (isset($_POST['inscription']) && $_POST['inscription'] == 'Registration') {

/*petit filtre pas du luxe */
foreach($_POST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_POST[$k]=$v;
}

foreach($_GET as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_GET[$k]=$v;
}

foreach($_REQUEST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_REQUEST[$k]=$v;
}
/*fin filtre*/

function conn(){
mysql_connect('localhost', 'user', 'password');
mysql_select_db('mydb');
}

// Vérification 1er email
function checkmail($mail){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email'])){
return true;
}else{
return false;
}
}

// Vérification 2ème email
function checkmail2($mail2){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email_sponsor'])){
return true;
}else{
return false;
}
}

function ismembre($login){
conn();
$log=mysql_real_escape_string($login);
// on recherche si ce login est déjà utilisé par un autre membre
$sql = "SELECT id FROM member WHERE login='".$log."' limit 1";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

if(mysql_fetch_row($req)===1){
return true;
}else{
return false;
}

mysql_close();
}


/*les tests*/

// on teste l'existence de nos variables. On teste également si elles ne sont pas vides
if(isset($_POST['login']) && !empty($_POST['login'])) { } else {$err.='<br>The Login is empty';}
if(isset($_POST['pass']) && !empty($_POST['pass'])) { } else {$err.='<br>The password is empty';}
if(isset($_POST['pass_confirm']) && !empty($_POST['pass_confirm'])) { } else {$err.='<br>the two passwords are different';}
if (isset($_POST['pass'],$_POST['pass_confirm']) && $_POST['pass'] === $_POST['pass_confirm']) { } else {$err.='<br>the two passwords are different';}


if(isset($_POST['email']) && !empty($_POST['email'])) {

if(checkmail($_POST['email'])===true) {
}else{
$err.='<br>Your email address is not valid';
}

}else {$err.='<br>Your email address is not valid';}


if(isset($_POST['email_sponsor']) && !empty($_POST['email_sponsor'])) {

if(checkmail2($_POST['email_sponsor'])===true) {
}else{
$err.='<br>The email address of your sponsor is not valid';
}

}else {$err.='<br>The email address of your sponsor is not valid';}

if(isset($_POST['sponsor']) && !empty($_POST['sponsor'])) { } else {$err.='<br>Sponsor is empty';}
if(isset($_POST['dream']) && !empty($_POST['dream'])) { } else {$err.='<br>Your Dream is empty !';}
if(isset($_POST['name']) && !empty($_POST['name'])) { } else {$err.='<br>Your Name is empty !';}
if(isset($_POST['lastname']) && !empty($_POST['lastname'])) { } else {$err.='<br>Your Lastname is empty !';}
if(isset($_POST['birth_day']) && !empty($_POST['birth_day'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_month']) && !empty($_POST['birth_month'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_year']) && !empty($_POST['birth_year'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['terms']) && !empty($_POST['terms'])) { } else {$err.='<br>Please Agree The Terms and Conditions';}

if(isset($_POST['login']) && strlen($_POST['login'])>2 && ismembre($_POST['login'])===false) {
}else{
$err.='<br>This login is already used by another member';
}

if(isset($_POST['security_code']) && !empty($_POST['security_code'])) { } else {$err.='<br>The captcha is empty !';}

if(($_SESSION['security_code'] === $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {

// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
unset($_SESSION['security_code']);

} else {
$err.='<br>The captcha was wrong<br>Please fill in all the required fields*';
}
// on teste si le visiteur a soumis le formulaire
if (empty($err) && isset($_POST['inscription']) && $_POST['inscription'] === 'Registration') {
//on insere les données en base et on redirige
conn();
$sql = 'INSERT INTO member VALUES("", "'.mysql_escape_string($_POST['login']).'", "'.mysql_escape_string(md5($_POST['pass'])).'", "'.mysql_escape_string($_POST['type']).'", "'.mysql_escape_string($_POST['name']).'", "'.mysql_escape_string($_POST['lastname']).'", "'.mysql_escape_string($_POST['birth_day']).'", "'.mysql_escape_string($_POST['birth_month']).'", "'.mysql_escape_string($_POST['birth_year']).'", "'.mysql_escape_string($_POST['address1']).'", "'.mysql_escape_string($_POST['address2']).'", "'.mysql_escape_string($_POST['job']).'", "'.mysql_escape_string($_POST['zipcode']).'", "'.mysql_escape_string($_POST['city']).'", "'.mysql_escape_string($_POST['state']).'", "'.mysql_escape_string($_POST['country']).'", "'.mysql_escape_string($_POST['email']).'", "'.mysql_escape_string($_POST['phone']).'", "'.mysql_escape_string($_POST['skype']).'", "'.mysql_escape_string($_POST['sponsor']).'", "'.mysql_escape_string($_POST['email_sponsor']).'", "'.mysql_escape_string($_POST['dream']).'", "'.mysql_escape_string($_POST['dream_price']).'", "'.mysql_escape_string($_POST['comment']).'", "'.mysql_escape_string($_POST['newsletter']).'", "'.mysql_escape_string($_POST['terms']).'", NOW())';
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
mysql_close();
$_SESSION['login'] = $_POST['login'];
header('Location: member.php');

//On récupère les valeurs du formulaire

if (get_magic_quotes_gpc())
{
$sponsor = stripslashes($_POST['sponsor']);
$login = stripslashes($_POST['login']);
$pass = stripslashes($_POST['pass']);
$email_sponsor = stripslashes($_POST['email_sponsor']);
$type = stripslashes($_POST['type']);
$name = stripslashes($_POST['name']);
$lastname = stripslashes($_POST['lastname']);
$birth_day = stripslashes($_POST['birth_day']);
$birth_month = stripslashes($_POST['birth_month']);
$birth_year = stripslashes($_POST['birth_year']);
$job = stripslashes($_POST['job']);
$address1 = stripslashes($_POST['address1']);
$address2 = stripslashes($_POST['address2']);
$zipcode = stripslashes($_POST['zipcode']);
$city = stripslashes($_POST['city']);
$state = stripslashes($_POST['state']);
$country = stripslashes($_POST['country']);
$phone = stripslashes($_POST['phone']);
$skype = stripslashes($_POST['skype']);
$email = stripslashes($_POST['email']);
$comment = stripslashes($_POST['comment']);
$terms = stripslashes($_POST['terms']);
}
else
{
$sponsor = $_POST['sponsor'];
$login = $_POST['login'];
$pass = $_POST['pass'];
$email_sponsor = $_POST['email_sponsor'];
$type = $_POST['type'];
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$birth_day = $_POST['birth_day'];
$birth_month = $_POST['birth_month'];
$birth_year = $_POST['birth_year'];
$job = $_POST['job'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$zipcode = $_POST['zipcode'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$skype = $_POST['skype'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$terms = $_POST['terms'];
}

//On crée le message email


// clé aléatoire de limite
$boundary = md5(uniqid(microtime(), TRUE));

// Headers
$headers = 'From: de moi <info@monfournisseur.com>'."\r\n";
$headers .= 'Mime-Version: 1.0'."\r\n";
$headers .= 'Content-Type: multipart/mixed;boundary='.$boundary."\r\n";
$headers .= "\r\n";

// Message 1 (TEXT)
$msg1 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg1 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg1 .= 'Compte user: '.$login."\r\n";
$msg1 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg1 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg1 .= 'State: '.$state."\r\n";
$msg1 .= 'Country: '.$country."\r\n\r\n";
$msg1 .= 'Email: '.$email."\r\n\r\n";
$msg1 .= 'blabla bla et re bla bla'."\r\n";
$msg1 .= 'Good day.'."\r\n\r\n";
$msg1 .= 'moi'."\r\n\r\n";

// Message 2 (TEXT)
$msg2 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg2 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg2 .= 'Compte user: '.$login."\r\n";
$msg2 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg2 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg2 .= 'State: '.$state."\r\n";
$msg2 .= 'Country: '.$country."\r\n\r\n";
$msg2 .= 'Email: '.$email."\r\n\r\n";
$msg2 .= 'blabla bla et re bla bla'."\r\n";
$msg2 .= 'Good day.'."\r\n\r\n";
$msg2 .= 'moi'."\r\n\r\n";

// Message 3 (HTML) le code HTML a été radicalement raccourci (pour éviter de prendre trop de place sur le forum)

$msg3 = '--'.$boundary."\r\n";
$msg3 .= 'Content-type: text/html; charset=iso-8859-1'."\r\n\r\n";
$msg3 .= '<div><table width="1024" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<font size="2" style="color:#051c54; font-family: Arial, Helvetica, sans-serif;">Bla bla et rebla bla.</font><br>
</td>
</tr>
</table>
</div>'."\r\n";

// Information au 1 destinataire
$recipient = "$email_sponsor"; //envois mail (TEXT)
$subject = "sujet 1"; //Sujet du mail(
mail($recipient, $subject, $msg1, $mailheaders); //Confirmation mail envoyé

// Information au 2ème destinataire
$recipient2 = "$email"; //envois mail
$subject2 = 'sujet 2 '; //Sujet du mail
mail($recipient2, $subject2, $msg2, $headers); //Confirmation mail envoyé )

// Information au 3ème destinataire
$recipient3 = "registration@monfournisseur.com"; //envois mail
$subject3 = "sujet 3"; //Sujet du mail
mail($recipient3, $subject3, $msg3, $headers); //Confirmation mail envoyé

$mailheaders = "From: monfournisseur.com<> \n"; //Depuis où le mail à été posté

exit;
}
}
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Registration</title>
<link rel="stylesheet" type="text/css" href="slide/engine1/style.css" />
<script src="/common/monfile.js" type="text/javascript"></script>
<link href="common/monfile.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="slide/engine1/jquery.js"></script>
<script language="JavaScript" type="text/javascript"></script>
<style type="text/css">
body {
background-image: url(/images/bg/bg_9.jpg);
overflow: hidden;
background-repeat: repeat;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
<script language="JavaScript">
<!--
function ucfirst(chaine){
if(chaine.length == 1){
return chaine.toUpperCase();
}
else if(chaine.length >= 1){
return chaine.substring(0,1).toUpperCase()+chaine.substring(1,chaine.length).toLowerCase();
}
else{
return "";
}
}
-->
</script>

</head>
<body style="background-color:#ffffff" onLoad="MM_preloadImages('images/en/btn_signup_click.png')" oncontextmenu="return copyright()">

<form action="registration.php" method="post" name="inscription" enctype="multipart/form-data">
<table width="100%" height="150"border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" height="150" valign="bottom"><table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
</table></td>
</tr>
<tr>
<td width="400" valign="bottom"><img src="images/Logo.png" width="400" height="132" /></td>
<td width="400" height="150" align="center" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="center" class="bodyWhite14"> </td>
</tr>
<tr>
<td height="60" align="center" valign="top">
</td>
</tr>
</table></td>
<td width="200" height="150" align="right" valign="middle"><img src="images/Logo.png" width="132" height="132" title="" /></td>
</tr>

</table></td>
</tr>
<tr>
<td align="center" valign="bottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#222222"><table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="bottom">
<table width="1000" height="410" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="center"><br /><fieldset>
<legend align="top" class="bodyWhite11" > <?php echo _(" R E G I S T R A T I O N ") ?> </legend><table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/reflet2.png">
<tr>
<td width="50%"><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b> 1. <?php echo _("LOGIN SESSION")?></b></td>
</tr>
<tr>
<td width="140" height="150" align="center" valign="middle"><img src="/images/icon_login.png" width="125" height="125" id="pins1" title="<?php echo _("Login") ?>"/></td>
<td width="358" colspan="-1" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" valign="top" class="loading"> </td>
<td height="25" valign="top" class="loading"><?php echo _("Please fill in all the required fields ") ?><font color="red">*</font></td>
</tr>
<tr>
<td width="32%" height="25"class="bodyWhite11"><?php echo _("Login") ?><font color="red">*</font></td>
<td width="68%" class="bodyWhite11"><input type="text" onKeyUp="this.value=ucfirst(this.value);" size="28" name="login" value="<?php if (isset($_POST['login'])) echo htmlentities(trim($_POST['login'])); ?>" tabindex="1"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Password") ?><font color="red">*</font></td>
<td class="bodyWhite11"><input type="password" name="pass" tabindex="2" size="28" value="<?php if (isset($_POST['pass'])) echo htmlentities(trim($_POST['pass'])); ?>"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Password confirm") ?><font color="red">*</font></td>
<td class="bodyWhite11"><input type="password" size="28" name="pass_confirm" tabindex="3" value="<?php if (isset($_POST['pass_confirm'])) echo htmlentities(trim($_POST['pass_confirm'])); ?>"></td>
</tr>
<tr>
<td colspan="2" valign="top" class="loading"><?php
if (isset($err)) echo '<br>',$err;
?></td>
</tr>

</table></td>
<td width="0" background="images/traitvert2.gif" ></td>
</tr>
</table></td>
<td><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b>2. <?php echo _("INFORMATION")?></b></td>
</tr>
<tr>
<td width="140" height="150" align="center" valign="middle"><img src="/images/icon_data.png" width="125" height="125" id="pins2" title="<?php echo _("My information") ?>"/></td>
<td width="346" colspan="-1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32%" height="25"class="bodyWhite11"><?php echo _("Gender") ?></td>
<td width="68%"class="bodyWhite11"><input type="radio" name="type" value="1" checked="checked" tabindex="4">
<?php echo _("Ms.") ?>
<input type="radio" name="type" value="Mrs." >
<?php echo _("Mrs.") ?>
<input type="radio" name="type" value="Mr." >
<?php echo _("Mr.") ?></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Name") ?><font color="red">*</font></td>
<td class="bodyWhite11"><input type="text" name="name" onKeyUp="this.value=ucfirst(this.value);" maxlength="40" size="37" class="body" tabindex="6" value="<?php if (isset($_POST['name'])) echo htmlentities(trim($_POST['name'])); ?>"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Lastname") ?><font color="red">*</font></td>
<td class="bodyWhite11"><input type="text" name="lastname" onKeyUp="this.value=ucfirst(this.value);" maxlength="15" size="37" class="body" value="<?php if (isset($_POST['lastname'])) echo htmlentities(trim($_POST['lastname'])); ?>" tabindex="7"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Date of birth") ?><font color="red">*</font></td>
<td class="bodyWhite11"><Select name="birth_day" class="body" tabindex="8">
<option selected value="<?php if (isset($_POST['birth_day'])) echo htmlentities(trim($_POST['birth_day'])); ?>"><?php echo _("Day") ?></option>
<?php
$i = 1; // initialisation de la variable de boucle
while( $i < 32 )
{
?>
<option value="<?php echo $i;?>"><?php echo $i?></option>
<?php // affichage
$i++; // incrémentation
}
?>
</select>
/
<select name="birth_month" class="body" tabindex="9">
<option selected value="<?php if (isset($_POST['birth_month'])) echo htmlentities(trim($_POST['birth_month'])); ?>"><?php echo _("month") ?></option>
<?php
$i = 1; // initialisation de la variable de boucle
while( $i < 13 )
{
?>
<option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php // affichage
$i++; // incrémentation
}
?>
</select>
/
<select name="birth_year" class="body" tabindex="10">
<option selected value="<?php if (isset($_POST['birth_year'])) echo htmlentities(trim($_POST['birth_year'])); ?>"><?php echo _("year") ?></option>
<?php
$i = 1909; // initialisation de la variable de boucle
while( $i <= Date("Y") )
{
?>
<option value=<?php echo $i;?>><?php echo $i;?></option>
<?php // affichage
$i++; // incrémentation
}
?>
</select></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Profession") ?></td>
<td class="bodyWhite11"><input type="text" name="job" onKeyUp="this.value=ucfirst(this.value);" maxlength="40" size="37" class="body" value="<?php if (isset($_POST['job'])) echo htmlentities(trim($_POST['job'])); ?>" tabindex="11"></td>
</tr>
</table></td>
<td width="1" ></td>
</tr>
</table></td>
</tr>
</table><br /><table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/reflet2.png">
<tr>
<td width="50%"><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b> 3. <?php echo _("ADDRESS")?></b></td>
</tr>
<tr>
<td width="140" height="150" align="center" valign="middle"><img src="/images/icon_address.png" width="125" height="125" id="pins1" title="<?php echo _("Address") ?>"/></td>
<td width="358" colspan="-1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32%" height="25" class="bodyWhite11"><?php echo _("Address 1") ?></td>
<td colspan="2" class="bodyWhite11"><input type="text" onKeyUp="this.value=ucfirst(this.value);" name="address1" maxlength="40" size="37" class="body" value="<?php if (isset($_POST['address1'])) echo htmlentities(trim($_POST['address1'])); ?>" tabindex="12"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Address 2") ?></td>
<td colspan="2" class="bodyWhite11"><input type="text" onKeyUp="this.value=ucfirst(this.value);" name="address2" maxlength="40" size="37" value="<?php if (isset($_POST['address2'])) echo htmlentities(trim($_POST['address2'])); ?>" class="body" tabindex="13"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Code ZIP/ City ") ?></td>
<td width="18%" class="bodyWhite11"><input type="text" name="zipcode" maxlength="6" size="5" class="content" value="<?php if (isset($_POST['zipcode'])) echo htmlentities(trim($_POST['zipcode'])); ?>" tabindex="14"></td>
<td width="53%" class="bodyWhite11"><input type="text" name="city" onKeyUp="this.value=ucfirst(this.value);" maxlength="20" size="25" value="<?php if (isset($_POST['city'])) echo htmlentities(trim($_POST['city'])); ?>" class="body" tabindex="15"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("State") ?></td>
<td colspan="2" class="bodyWhite11"><input type="text" name="state" maxlength="40" size="37" class="body" onKeyUp="this.value=ucfirst(this.value);" value="<?php if (isset($_POST['state'])) echo htmlentities(trim($_POST['state'])); ?>" tabindex="16"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Country") ?></td>
<td height="25" colspan="2" class="bodyWhite11"><select name="country" tabindex="17">
<option value="<?php if (isset($_POST['country'])) echo htmlentities(trim($_POST['country'])); ?>" selected="selected">Select a Country</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Aruba">Aruba</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahamas">Bahamas</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Barbados">Barbados</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Belize">Belize</option>
<option value="Benin">Benin</option>
<option value="Bermuda">Bermuda</option>
<option value="Bhutan">Bhutan</option>
<option value="Bolivia">Bolivia</option>
<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
<option value="Botswana">Botswana</option>
<option value="Bouvet Island">Bouvet Island</option>
<option value="Brazil">Brazil</option>
<option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
<option value="Brunei Darussalam">Brunei Darussalam</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Burkina Faso">Burkina Faso</option>
<option value="Burundi">Burundi</option>
<option value="Cambodia">Cambodia</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Cape Verde">Cape Verde</option>
<option value="Cayman Islands">Cayman Islands</option>
<option value="Central African Republic">Central African Republic</option>
<option value="Chad">Chad</option>
<option value="Chile">Chile</option>
<option value="China">China</option>
<option value="Christmas Island">Christmas Island</option>
<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
<option value="Colombia">Colombia</option>
<option value="Comoros">Comoros</option>
<option value="Congo">Congo</option>
<option value="Congo, The Democratic Republic of The">Congo, Republic of The</option>
<option value="Cook Islands">Cook Islands</option>
<option value="Costa Rica">Costa Rica</option>
<option value="Cote D'ivoire">Cote D'ivoire</option>
<option value="Croatia">Croatia</option>
<option value="Cuba">Cuba</option>
<option value="Cyprus">Cyprus</option>
<option value="Czech Republic">Czech Republic</option>
<option value="Denmark">Denmark</option>
<option value="Djibouti">Djibouti</option>
<option value="Dominica">Dominica</option>
<option value="Dominican Republic">Dominican Republic</option>
<option value="Ecuador">Ecuador</option>
<option value="Egypt">Egypt</option>
<option value="El Salvador">El Salvador</option>
<option value="Equatorial Guinea">Equatorial Guinea</option>
<option value="Eritrea">Eritrea</option>
<option value="Estonia">Estonia</option>
<option value="Ethiopia">Ethiopia</option>
<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
<option value="Faroe Islands">Faroe Islands</option>
<option value="Fiji">Fiji</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="French Guiana">French Guiana</option>
<option value="French Polynesia">French Polynesia</option>
<option value="French Southern Territories">French Southern Territories</option>
<option value="Gabon">Gabon</option>
<option value="Gambia">Gambia</option>
<option value="Georgia">Georgia</option>
<option value="Germany">Germany</option>
<option value="Ghana">Ghana</option>
<option value="Gibraltar">Gibraltar</option>
<option value="Greece">Greece</option>
<option value="Greenland">Greenland</option>
<option value="Grenada">Grenada</option>
<option value="Guadeloupe">Guadeloupe</option>
<option value="Guam">Guam</option>
<option value="Guatemala">Guatemala</option>
<option value="Guinea">Guinea</option>
<option value="Guinea-bissau">Guinea-bissau</option>
<option value="Guyana">Guyana</option>
<option value="Haiti">Haiti</option>
<option value="Heard Island and Mcdonald Islands">Heard and Mcdonald Islands</option>
<option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
<option value="Honduras">Honduras</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Hungary">Hungary</option>
<option value="Iceland">Iceland</option>
<option value="India">India</option>
<option value="Indonesia">Indonesia</option>
<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
<option value="Iraq">Iraq</option>
<option value="Ireland">Ireland</option>
<option value="Israel">Israel</option>
<option value="Italy">Italy</option>
<option value="Jamaica">Jamaica</option>
<option value="Japan">Japan</option>
<option value="Jordan">Jordan</option>
<option value="Kazakhstan">Kazakhstan</option>
<option value="Kenya">Kenya</option>
<option value="Kiribati">Kiribati</option>
<option value="Korea, Republic of">Korea, Republic of</option>
<option value="Kuwait">Kuwait</option>
<option value="Kyrgyzstan">Kyrgyzstan</option>
<option value="Lao People's Democratic Republic">Lao People's</option>
<option value="Latvia">Latvia</option>
<option value="Lebanon">Lebanon</option>
<option value="Lesotho">Lesotho</option>
<option value="Liberia">Liberia</option>
<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
<option value="Liechtenstein">Liechtenstein</option>
<option value="Lithuania">Lithuania</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macao">Macao</option>
<option value="Macedonia, The Former Yugoslav Republic of">Macedonia</option>
<option value="Madagascar">Madagascar</option>
<option value="Malawi">Malawi</option>
<option value="Malaysia">Malaysia</option>
<option value="Maldives">Maldives</option>
<option value="Mali">Mali</option>
<option value="Malta">Malta</option>
<option value="Marshall Islands">Marshall Islands</option>
<option value="Martinique">Martinique</option>
<option value="Mauritania">Mauritania</option>
<option value="Mauritius">Mauritius</option>
<option value="Mayotte">Mayotte</option>
<option value="Mexico">Mexico</option>
<option value="Micronesia, Federated States of">Micronesia, States of</option>
<option value="Moldova, Republic of">Moldova, Republic of</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Mongolia</option>
<option value="Montserrat">Montserrat</option>
<option value="Morocco">Morocco</option>
<option value="Mozambique">Mozambique</option>
<option value="Myanmar">Myanmar</option>
<option value="Namibia">Namibia</option>
<option value="Nauru">Nauru</option>
<option value="Nepal">Nepal</option>
<option value="Netherlands">Netherlands</option>
<option value="Netherlands Antilles">Netherlands Antilles</option>
<option value="New Caledonia">New Caledonia</option>
<option value="New Zealand">New Zealand</option>
<option value="Nicaragua">Nicaragua</option>
<option value="Niger">Niger</option>
<option value="Nigeria">Nigeria</option>
<option value="Niue">Niue</option>
<option value="Norfolk Island">Norfolk Island</option>
<option value="Northern Mariana Islands">Northern Mariana Islands</option>
<option value="Norway">Norway</option>
<option value="Oman">Oman</option>
<option value="Pakistan">Pakistan</option>
<option value="Palau">Palau</option>
<option value="Palestinian Territory, Occupied">Palestinian </option>
<option value="Panama">Panama</option>
<option value="Papua New Guinea">Papua New Guinea</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Philippines">Philippines</option>
<option value="Pitcairn">Pitcairn</option>
<option value="Poland">Poland</option>
<option value="Portugal">Portugal</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Qatar">Qatar</option>
<option value="Reunion">Reunion</option>
<option value="Romania">Romania</option>
<option value="Russian Federation">Russian Federation</option>
<option value="Rwanda">Rwanda</option>
<option value="Saint Helena">Saint Helena</option>
<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
<option value="Saint Lucia">Saint Lucia</option>
<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
<option value="Saint Vincent and The Grenadines">Saint Vincent and Grenadines</option>
<option value="Samoa">Samoa</option>
<option value="San Marino">San Marino</option>
<option value="Sao Tome and Principe">Sao Tome and Principe</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Senegal">Senegal</option>
<option value="Serbia and Montenegro">Serbia and Montenegro</option>
<option value="Seychelles">Seychelles</option>
<option value="Sierra Leone">Sierra Leone</option>
<option value="Singapore">Singapore</option>
<option value="Slovakia">Slovakia</option>
<option value="Slovenia">Slovenia</option>
<option value="Solomon Islands">Solomon Islands</option>
<option value="Somalia">Somalia</option>
<option value="South Africa">South Africa</option>
<option value="South Georgia and The South Sandwich Islands">South Georgia</option>
<option value="Spain">Spain</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Sudan">Sudan</option>
<option value="Suriname">Suriname</option>
<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
<option value="Swaziland">Swaziland</option>
<option value="Sweden">Sweden</option>
<option value="Switzerland">Switzerland</option>
<option value="Syrian Arab Republic">Syrian Arab Republic</option>
<option value="Taiwan, Province of China">Taiwan, Province of China</option>
<option value="Tajikistan">Tajikistan</option>
<option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
<option value="Thailand">Thailand</option>
<option value="Timor-leste">Timor-leste</option>
<option value="Togo">Togo</option>
<option value="Tokelau">Tokelau</option>
<option value="Tonga">Tonga</option>
<option value="Trinidad and Tobago">Trinidad and Tobago</option>
<option value="Tunisia">Tunisia</option>
<option value="Turkey">Turkey</option>
<option value="Turkmenistan">Turkmenistan</option>
<option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
<option value="Tuvalu">Tuvalu</option>
<option value="Uganda">Uganda</option>
<option value="Ukraine">Ukraine</option>
<option value="United Arab Emirates">United Arab Emirates</option>
<option value="United Kingdom">United Kingdom</option>
<option value="United States selected="selected"">United States</option>
<option value="United States Minor Outlying Islands">US Minor Outlying Islands</option>
<option value="Uruguay">Uruguay</option>
<option value="Uzbekistan">Uzbekistan</option>
<option value="Vanuatu">Vanuatu</option>
<option value="Venezuela">Venezuela</option>
<option value="Viet Nam">Viet Nam</option>
<option value="Virgin Islands, British">Virgin Islands, British</option>
<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
<option value="Wallis and Futuna">Wallis and Futuna</option>
<option value="Western Sahara">Western Sahara</option>
<option value="Yemen">Yemen</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
</optgroup>
</select></td>
</tr>
</table></td>
<td width="0" background="images/traitvert2.gif" ></td>
</tr>
</table></td>
<td><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b> 4. <?php echo _("COMMUNICATION")?></b></td>
</tr>
<tr>
<td width="140" height="150" align="center" valign="middle"><img src="/images/icon_communication.png" width="125" height="125" id="pins2" title="<?php echo _("Communications") ?>"/></td>
<td width="346" colspan="-1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32%" height="25" class="bodyWhite11"><?php echo _("Email") ?><font color="red">*</font></td>
<td width="68%"class="bodyWhite11"><input type="text" name="email" size="37" class="body" value="<?php if (isset($_POST["email"])){ echo $_POST["email"];} ?>" tabindex="18"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Phone") ?></td>
<td class="bodyWhite11"><input type="text" name="phone" maxlength="40" size="37" class="body" value="<?php if (isset($_POST['phone'])) echo htmlentities(trim($_POST['phone'])); ?>" tabindex="19"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Skype ID") ?></td>
<td class="bodyWhite11"><input type="text" name="skype" maxlength="40" size="37" class="body" value="<?php if (isset($_POST['skype'])) echo htmlentities(trim($_POST['skype'])); ?>" tabindex="20"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"></td>
<td class="bodyWhite11"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"></td>
<td class="bodyWhite11"></td>
</tr>
</table></td>
<td width="1" ></td>
</tr>
</table></td>
</tr>
</table><br /><table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/reflet2.png">
<tr>
<td width="50%"><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b> 6. <?php echo _("QUESTIONS")?></b></td>
</tr>
<tr>
<td width="18" height="150" align="center" valign="middle"> </td>
<td width="480" colspan="-1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" height="25" valign="top" class="bodyWhite11"><?php echo _("Who or what are you invited") ?><font color="red">*</font></td>
<td width="50%" class="bodyWhite11"><input type="text" name="sponsor" onKeyUp="this.value=ucfirst(this.value);" maxlength="40" size="37" class="body" tabindex="21" value="<?php if (isset($_POST['sponsor'])) echo htmlentities(trim($_POST['sponsor'])); ?>"></td>
</tr>
<tr>
<td width="50%" height="25" valign="top" class="bodyWhite11"><?php echo _("Email of your Sponsor") ?><font color="red">*</font></td>
<td width="50%" class="bodyWhite11"><input type="text" name="email_sponsor" maxlength="40" size="37" class="body" tabindex="22" value="<?php if (isset($_POST['email_sponsor'])) echo htmlentities(trim($_POST['email_sponsor'])); ?>"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("What is your dream ?") ?><font color="red">*</font></td>
<td rowspan="2" class="bodyWhite11"><textarea name="dream" onKeyUp="this.value=ucfirst(this.value);" cols="37" rows="3" wrap="VIRTUAL" class="body" tabindex="23" value="<?php if (isset($_POST['dream'])) echo htmlentities(trim($_POST['dream'])); ?>"></textarea></td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("Do you know the price ?") ?></td>
<td height="25" class="bodyWhite11"><input type="text" name="dream_price" maxlength="40" size="37" class="body" value="<?php if (isset($_POST['dream_price'])) echo htmlentities(trim($_POST['dream_price'])); ?>" tabindex="24"></td>
</tr>
</table></td>
<td width="0" background="images/traitvert2.gif" ></td>
</tr>
</table></td>
<td><table width="100%" height="170" border="0" cellspacing="0" >
<tr>
<td height="15" colspan="3" valign="middle" background="images/barrehoriz1.png" class="contentBlack12"><b>7. <?php echo _("SUGGESTION")?></b></td>
</tr>
<tr>
<td width="19" height="150" align="center" valign="middle"> </td>
<td width="470" colspan="-1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="51%" height="25" valign="top" class="bodyWhite11"><?php echo _("Comment / message for the Team") ?></td>
<td width="49%" rowspan="2"class="bodyWhite11"><textarea onKeyUp="this.value=ucfirst(this.value);" name="comment" cols="37" rows="6" wrap="VIRTUAL" class="body" value="<?php if (isset($_POST['comment'])) echo htmlentities(trim($_POST['comment'])); ?>" tabindex="25"></textarea></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"> </td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><?php echo _("I want to receive the News") ?></td>
<td class="bodyWhite11"><input type="radio" name="newsletter" value="1" tabindex="26">
<?php echo _("YES") ?><input type="radio" name="newsletter" checked="checked" value="0" tabindex="27">
<?php echo _("NO") ?></td>
</tr>
<tr>
<td class="bodyWhite11"></td>
<td class="bodyWhite11"></td>
</tr>
<tr>
<td height="25" class="bodyWhite11"><a href="javascript:dartPopup(1, '/pages/en/conditionsofuse.php', 0, 1000, 600, 0, 0, 1)" target="_self" class="bodyWhite11"><u><?php echo _("I Agree to the Terms and Conditions") ?></u></a><font color="red">*</font></td>
<td height="25" class="bodyWhite11"><input type="radio" name="terms" value="1" tabindex="28">
<?php echo _("YES") ?><input type="radio" checked="checked" name="terms" value="0" tabindex="29">
<?php echo _("NO") ?></td>
</tr>
</table></td>
<td width="4" ></td>
</tr>
</table></td>
Messages postés
31488
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
25 février 2021
344
Merci mais non...
Les balises de code... comme ça:
<? Php
    Echo "c'est du code...."
//voilou...
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013

les balise du code php sont intégrées.. ,les voici à nouveaux tout est dans la meme page.

<?php
session_start();
/*ici le session_start();*/
$err = null; /*au depart*/

//echo '<pre>';
//print_r($_POST);
//echo '</pre>';

// on teste si le visiteur a soumis le formulaire
if (isset($_POST['inscription']) && $_POST['inscription'] == 'Registration') {

/*petit filtre pas du luxe */
foreach($_POST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_POST[$k]=$v;
}

foreach($_GET as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_GET[$k]=$v;
}

foreach($_REQUEST as $k => $v){
$v = htmlentities(strip_tags(trim($v)));
$_REQUEST[$k]=$v;
}
/*fin filtre*/

function conn(){
mysql_connect('localhost', 'user', 'password');
mysql_select_db('mydb');
}

// Vérification 1er email
function checkmail($mail){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email'])){
return true;
}else{
return false;
}
}

// Vérification 2ème email
function checkmail2($mail2){
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_'{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email_sponsor'])){
return true;
}else{
return false;
}
}

function ismembre($login){
conn();
$log=mysql_real_escape_string($login);
// on recherche si ce login est déjà utilisé par un autre membre
$sql = "SELECT id FROM member WHERE login='".$log."' limit 1";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

if(mysql_fetch_row($req)===1){
return true;
}else{
return false;
}

mysql_close();
}


/*les tests*/

// on teste l'existence de nos variables. On teste également si elles ne sont pas vides
if(isset($_POST['login']) && !empty($_POST['login'])) { } else {$err.='<br>The Login is empty';}
if(isset($_POST['pass']) && !empty($_POST['pass'])) { } else {$err.='<br>The password is empty';}
if(isset($_POST['pass_confirm']) && !empty($_POST['pass_confirm'])) { } else {$err.='<br>the two passwords are different';}
if (isset($_POST['pass'],$_POST['pass_confirm']) && $_POST['pass'] === $_POST['pass_confirm']) { } else {$err.='<br>the two passwords are different';}


if(isset($_POST['email']) && !empty($_POST['email'])) {

if(checkmail($_POST['email'])===true) {
}else{
$err.='<br>Your email address is not valid';
}

}else {$err.='<br>Your email address is not valid';}


if(isset($_POST['email_sponsor']) && !empty($_POST['email_sponsor'])) {

if(checkmail2($_POST['email_sponsor'])===true) {
}else{
$err.='<br>The email address of your sponsor is not valid';
}

}else {$err.='<br>The email address of your sponsor is not valid';}

if(isset($_POST['sponsor']) && !empty($_POST['sponsor'])) { } else {$err.='<br>Sponsor is empty';}
if(isset($_POST['dream']) && !empty($_POST['dream'])) { } else {$err.='<br>Your Dream is empty !';}
if(isset($_POST['name']) && !empty($_POST['name'])) { } else {$err.='<br>Your Name is empty !';}
if(isset($_POST['lastname']) && !empty($_POST['lastname'])) { } else {$err.='<br>Your Lastname is empty !';}
if(isset($_POST['birth_day']) && !empty($_POST['birth_day'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_month']) && !empty($_POST['birth_month'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['birth_year']) && !empty($_POST['birth_year'])) { } else {$err.='<br>Please select your birthday';}
if(isset($_POST['terms']) && !empty($_POST['terms'])) { } else {$err.='<br>Please Agree The Terms and Conditions';}

if(isset($_POST['login']) && strlen($_POST['login'])>2 && ismembre($_POST['login'])===false) {
}else{
$err.='<br>This login is already used by another member';
}

if(isset($_POST['security_code']) && !empty($_POST['security_code'])) { } else {$err.='<br>The captcha is empty !';}

if(($_SESSION['security_code'] === $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {

// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
unset($_SESSION['security_code']);

} else {
$err.='<br>The captcha was wrong<br>Please fill in all the required fields*';
}
// on teste si le visiteur a soumis le formulaire
if (empty($err) && isset($_POST['inscription']) && $_POST['inscription'] === 'Registration') {
//on insere les données en base et on redirige
conn();
$sql = 'INSERT INTO member VALUES("", "'.mysql_escape_string($_POST['login']).'", "'.mysql_escape_string(md5($_POST['pass'])).'", "'.mysql_escape_string($_POST['type']).'", "'.mysql_escape_string($_POST['name']).'", "'.mysql_escape_string($_POST['lastname']).'", "'.mysql_escape_string($_POST['birth_day']).'", "'.mysql_escape_string($_POST['birth_month']).'", "'.mysql_escape_string($_POST['birth_year']).'", "'.mysql_escape_string($_POST['address1']).'", "'.mysql_escape_string($_POST['address2']).'", "'.mysql_escape_string($_POST['job']).'", "'.mysql_escape_string($_POST['zipcode']).'", "'.mysql_escape_string($_POST['city']).'", "'.mysql_escape_string($_POST['state']).'", "'.mysql_escape_string($_POST['country']).'", "'.mysql_escape_string($_POST['email']).'", "'.mysql_escape_string($_POST['phone']).'", "'.mysql_escape_string($_POST['skype']).'", "'.mysql_escape_string($_POST['sponsor']).'", "'.mysql_escape_string($_POST['email_sponsor']).'", "'.mysql_escape_string($_POST['dream']).'", "'.mysql_escape_string($_POST['dream_price']).'", "'.mysql_escape_string($_POST['comment']).'", "'.mysql_escape_string($_POST['newsletter']).'", "'.mysql_escape_string($_POST['terms']).'", NOW())';
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
mysql_close();
$_SESSION['login'] = $_POST['login'];
header('Location: member.php');

//On récupère les valeurs du formulaire

if (get_magic_quotes_gpc())
{
$sponsor = stripslashes($_POST['sponsor']);
$login = stripslashes($_POST['login']);
$pass = stripslashes($_POST['pass']);
$email_sponsor = stripslashes($_POST['email_sponsor']);
$type = stripslashes($_POST['type']);
$name = stripslashes($_POST['name']);
$lastname = stripslashes($_POST['lastname']);
$birth_day = stripslashes($_POST['birth_day']);
$birth_month = stripslashes($_POST['birth_month']);
$birth_year = stripslashes($_POST['birth_year']);
$job = stripslashes($_POST['job']);
$address1 = stripslashes($_POST['address1']);
$address2 = stripslashes($_POST['address2']);
$zipcode = stripslashes($_POST['zipcode']);
$city = stripslashes($_POST['city']);
$state = stripslashes($_POST['state']);
$country = stripslashes($_POST['country']);
$phone = stripslashes($_POST['phone']);
$skype = stripslashes($_POST['skype']);
$email = stripslashes($_POST['email']);
$comment = stripslashes($_POST['comment']);
$terms = stripslashes($_POST['terms']);
}
else
{
$sponsor = $_POST['sponsor'];
$login = $_POST['login'];
$pass = $_POST['pass'];
$email_sponsor = $_POST['email_sponsor'];
$type = $_POST['type'];
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$birth_day = $_POST['birth_day'];
$birth_month = $_POST['birth_month'];
$birth_year = $_POST['birth_year'];
$job = $_POST['job'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$zipcode = $_POST['zipcode'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$skype = $_POST['skype'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$terms = $_POST['terms'];
}

//On crée le message email


// clé aléatoire de limite
$boundary = md5(uniqid(microtime(), TRUE));

// Headers
$headers = 'From: de moi <info@monfournisseur.com>'."\r\n";
$headers .= 'Mime-Version: 1.0'."\r\n";
$headers .= 'Content-Type: multipart/mixed;boundary='.$boundary."\r\n";
$headers .= "\r\n";

// Message 1 (TEXT)
$msg1 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg1 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg1 .= 'Compte user: '.$login."\r\n";
$msg1 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg1 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg1 .= 'State: '.$state."\r\n";
$msg1 .= 'Country: '.$country."\r\n\r\n";
$msg1 .= 'Email: '.$email."\r\n\r\n";
$msg1 .= 'blabla bla et re bla bla'."\r\n";
$msg1 .= 'Good day.'."\r\n\r\n";
$msg1 .= 'moi'."\r\n\r\n";

// Message 2 (TEXT)
$msg2 = 'Hello '.$sponsor.','."\r\n\r\n";
$msg2 .= 'blablabla et bla bla.'."\r\n\r\n";
$msg2 .= 'Compte user: '.$login."\r\n";
$msg2 .= 'Name: '.$type.' '.$name.' '.$lastname."\r\n";
$msg2 .= 'Address: '.$zipcode.' - '.$city."\r\n";
$msg2 .= 'State: '.$state."\r\n";
$msg2 .= 'Country: '.$country."\r\n\r\n";
$msg2 .= 'Email: '.$email."\r\n\r\n";
$msg2 .= 'blabla bla et re bla bla'."\r\n";
$msg2 .= 'Good day.'."\r\n\r\n";
$msg2 .= 'moi'."\r\n\r\n";

// Message 3 (HTML) le code HTML a été radicalement raccourci (pour éviter de prendre trop de place sur le forum)

$msg3 = '--'.$boundary."\r\n";
$msg3 .= 'Content-type: text/html; charset=iso-8859-1'."\r\n\r\n";
$msg3 .= '<div><table width="1024" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<font size="2" style="color:#051c54; font-family: Arial, Helvetica, sans-serif;">Bla bla et rebla bla.</font><br>
</td>
</tr>
</table>
</div>'."\r\n";

// Information au 1 destinataire
$recipient = "$email_sponsor"; //envois mail (TEXT)
$subject = "sujet 1"; //Sujet du mail(
mail($recipient, $subject, $msg1, $mailheaders); //Confirmation mail envoyé

// Information au 2ème destinataire
$recipient2 = "$email"; //envois mail
$subject2 = 'sujet 2 '; //Sujet du mail
mail($recipient2, $subject2, $msg2, $headers); //Confirmation mail envoyé )

// Information au 3ème destinataire
$recipient3 = "registration@monfournisseur.com"; //envois mail
$subject3 = "sujet 3"; //Sujet du mail
mail($recipient3, $subject3, $msg3, $headers); //Confirmation mail envoyé

$mailheaders = "From: monfournisseur.com<> \n"; //Depuis où le mail à été posté

exit;
}
}
?>
Messages postés
31488
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
25 février 2021
344
Je sens que ça va être dur. ...
As tu vu la mise en page de mon code ??
Tu as une icone lorsque tu écris tes messages sur le forum qui permet d'inserer des balises de code :< code>< /code>....
Mes y le code !
Messages postés
22
Date d'inscription
lundi 22 août 2005
Statut
Membre
Dernière intervention
14 décembre 2013

hello... Jordane,...

après... de longue recherche ( plus de 3 jours et des tentatives à me faire écrouler sur mon clavier.. j'y suis arrivé... ca marche... ) comme quoi.. faut toujours persévérer.... bon j'ai des autres pages qui arrive ets des autres difficultés.. mais j'aviserai ou cas ou.

merci pour le temps qui tu aura passé à jeté un oeil..
très bonne journée à toi.