Bonjour

j ai un soucis que je n'arrive pas a résoudre : sur un formulaire d'inscription, on peut s'inscrire en tant que pro ou simple visiteur. En visiteur, le mail de confirmation / validation est envoyé et reçu. En mode pro, l'email n'est pas reçu. Je n'arrive pas à savoir pourquoi. Si quelqu'un a une idée...

Merci beaucoup :-)

le php sur la page contact
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?
include("header.inc.php");
 
$tmpself=$_SERVER["PHP_SELF"];
$tab_tmpself=split('/',$tmpself);
$selfurl='http://'.$_SERVER["SERVER_NAME"].ereg_replace($tab_tmpself[(count($tab_tmpself)-1)],'',$tmpself);
?>
blablabla...
 
 
  <?
	if ($_GET["type_user"]=="pro" || $_GET["type_user"]=="internaute") { 
	?>
 
 
	<? if ($_GET["type_user"]=="pro") { ?><div id="intro-promo-contact"><div class="contentclub"></div></div><? } else { ?><div id="intro-promo-contact2"><div class="contentclub"></div></div><? } ?>
 <div id="form">
 
		<ul id="rubs-home">
		<li>
	  	<h1 style="font-size:14px;"><? if ($_GET["type_user"]=="pro") { ?>S'inscrire en tant que professionnel<? } else { ?>Gagnez des points à chaque fois!<? } ?></h1>
 
		<form name="form_resto" action="#" method="post">
 
            <?
            if ($_GET["type_user"]=="pro")
			{
				?>
			<p style="padding-bottom:5px; font-size:13px;"><br /><br />Déjà inscrit ? Connectez-vous en vous rendant sur votre <br /><a href="identification.php">espace restaurateurs</a></p></li>
            <?
			}
			else 
			{
				?>
                			<p style="padding-bottom:5px; font-size:14px;"><br />Déjà inscrit ? Connectez-vous en vous rendant sur votre <br /><a href="identification.php">espace Restonaute</a></p></li>
                <?
			}
			?>
         <!--<h2>Informations sur le restaurant</h2>
			<p><strong>Nom du restaurant:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="title" value="<?=htmlentities(stripslashes($_POST["title"]));?>"/></p>
			<p><strong>Adresse:</strong> <span>*</span></p>
			<p class="pb6"><textarea name="address"><?=htmlentities(stripslashes($_POST["address"]));?></textarea></p>
			<p><strong>Code postal:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="cap" style="width:120px;" value="<?=htmlentities(stripslashes($_POST["cap"]));?>"/></p>
			<p><strong>Ville:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="city" value="<?=htmlentities(stripslashes($_POST["city"]));?>"/></p>
			<p><strong>Téléphone du restaurant:</strong></p>
			<p class="pb6"><input type="text" name="phone" value="<?=htmlentities(stripslashes($_POST["phone"]));?>"/></p>
			<p><strong>Fax:</strong></p>
			<p class="pb6"><input type="text" name="fax" value="<?=htmlentities(stripslashes($_POST["fax"]));?>"/></p>
			<!--<p><strong>Description du restaurant:</strong> <span>*</span></p>
			<p class="pb6"><textarea name="description" style="height:75px;"><?=htmlentities(stripslashes($_POST["description"]));?></textarea></p>-->
			<li>
			<li <? if ($_GET["type_user"]=="internaute") { echo '2'; } ?> ><h2>Vous</h2>
			<p><strong>Nom:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="nom" value="<?=htmlentities(stripslashes($_POST["nom"]));?>"/></p><br />
			<p><strong>Prénom:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="prenom" value="<?=htmlentities(stripslashes($_POST["prenom"]));?>"/></p><br />
            <p><strong>Votre date anniversaire:</strong></p>
			<p class="pb6"><input type="text" name="position" value="<?=htmlentities(stripslashes($_POST["position"]));?>"/></p><br />
			<p><strong>Adresse email:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="email" value="<?=htmlentities(stripslashes($_POST["email"]));?>"/></p>	<br />		
            <p><strong>Confirmez votre adresse email:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="email2" value="<?=htmlentities(stripslashes($_POST["email2"]));?>"/></p><br />			
			<p><strong>Téléphone:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="phone_perso" value="<?=htmlentities(stripslashes($_POST["phone_perso"]));?>"/></p><br />
			<i>blabla.</i>
           </li></li>
		   <li class="last
            <? if ($_GET["type_user"]=="internaute") { echo '2'; } ?>">
             <?
			if ($_GET["type_user"]=='pro')
			{
			?>
            <h2>Votre restaurant</h2><br />
            <p><strong>Nom de votre restaurant:</strong> <span>*</span></p>
			<p class="pb6"><input type="text" name="title" value="<?=htmlentities(stripslashes($_POST["title"]));?>"/></p><br />
            <?
			}
			?>
 
            <h2>Votre mot de passe</h2>
			<p><strong>Mot de passe:</strong> <span>*</span> (<em style="font-size:9px;">entre 6 et 15 caractères</em>)</p>
			<p class="pb6"><input type="password" name="pwd" value=""/></p><br />
			<p><strong>Confirmez votre mot de passe:</strong> <span>*</span></p>
			<p class="pb6"><input type="password" name="pwd2" value=""/></p><br />
			<p><br /><input type="submit" name="submit_inscription" value="Je m'inscris !" style="width:auto;"/></p></li>
 
			</ul>
 
		</form>
 
				<?
	}
	else 
	{
		?>
        <div id="entete_contact" style="background-image:url(images/fond_contact.png);">
        	<ul id="rubs-home">
 
            	<li>. </li><li>. </li><li>. </li><li class="last">   
		        <p><select name="type_user" style="font-size:16px;" onchange="if (this.value!='0') { window.location='contact.php?type_user='+this.value; }"><option value="0">Sélectionnez...</option><option value="pro">Je suis Restaurateur</option><option value="internaute">Devenir Restonaute</option></select></p></li></ul>
 
        </div>
 
        <?
	}	
	?>
</div>
Le header qui traite...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
else if ($_POST["submit_inscription"])
{
	$resto_title=trim($_POST["title"]);
	//$description=trim($_POST["description"]);
	$resto_address=trim($_POST["address"]);
	$resto_city=trim($_POST["city"]);
	$resto_cap=trim($_POST["cap"]);
	$resto_phone=trim($_POST["phone"]);
	$resto_fax=trim($_POST["fax"]);
 
	$nom=trim($_POST["nom"]);
	$prenom=trim($_POST["prenom"]);
	$position=trim($_POST["position"]);
	$phone=trim($_POST["phone_perso"]);
	$email=trim($_POST["email"]);
	$email2=trim($_POST["email2"]);
	$restaurant=trim($_POST["restaurant"]);
 
	$pwd=trim($_POST["pwd"]);
	$pwd2=trim($_POST["pwd2"]);
	//if ($resto_title=='' ||  $email=='' || $email2=='' || $nom=='' ||  $phone=='' || $pwd=='' || $pwd2=='')
	if ( $email=='' || $email2=='' || $phone=='' || $pwd=='' || $pwd2=='')
	{
		$tab_erreur[0]="Veuillez renseignez tous les champs obligatoires !";
	}
	else if (isValidEmail($email)==false)
	{
		$tab_erreur[0]="Votre adresse email n'est pas valide !";
	}
	else if ($email!=$email2)
	{
		$tab_erreur[0]="Veuillez renseigner deux adresses email identiques !";
	}
	else if (strlen($pwd)<6 || strlen($pwd)>15)
	{
		$tab_erreur[0]="Veuillez renseigner un mot de passe comprenant entre 6 et 15 caractères !";
	}
	else if ($pwd!=$pwd2)
	{
		$tab_erreur[0]="Veuillez renseigner deux mots de passe identiques !";
	}
	else 
	{
		$qexists = mysql_query("SELECT COUNT(id_user) FROM users WHERE email='$email'");
		$rexists = mysql_fetch_row($qexists);
		if ($rexists[0]>0)
		{
			?>
			<script type="text/javascript">
			alert('Un compte a déjà été créé avec cette adresse email suryoyo.com. En cas de perte de mot de passe, vous pouvez récupérer vos identifiants en cliquant sur le lien prévu à cet effet. Pour plus d\'informations, n\'hésitez pas à nous contacter.');
			</script>
			<?
		}
		else 
		{
			$ip=$_SERVER['REMOTE_ADDR'];
			$key=random_charac(25);
			//mysql_query("INSERT INTO users SET nom='$nom', prenom='$prenom', pwd='$pwd', email='$email', phone='$phone', position='$position', resto_title='$resto_title', resto_address='$resto_address', resto_phone='$resto_phone', resto_fax='$resto_fax', resto_city='$resto_city', resto_cap='$resto_cap', date=NOW(), ip='$ip', status='0', `key`='$key'");
			mysql_query("INSERT INTO users SET nom='$nom', prenom='$prenom', pwd='$pwd', email='$email', phone='$phone', position='$position', date=NOW(), ip='$ip', restaurant='$restaurant', status='0', `key`='$key'");
			$id=mysql_insert_id();
 
			$sujet="yoyo.com - Validez votre inscription";
			$sujet_admin="Nouvelle inscription";
 
			$msg_admin='Une nouvelle inscription a eu lieu sur yoyo.com <a href="mailto:'.$email.'">'.$email.'</a> ( ip: '.$ip.' ).<br /><br />INFORMATIONS PERSONNELLES DU NOUVEAU MEMBRE:<br /><br />
			<strong>Nom</strong>: '.$nom.'<br />
			<strong>Prénom</strong>: '.$prenom.'<br />
			<strong>Nom du resto</strong>: '.$restaurant.'<br />
			<strong>Position</strong>: '.$position.'<br />
			<strong>Tél perso</strong>: '.$phone.'<br />
			<strong>Email</strong>:'.$email.'<br /><br />';
 
			$msg="Votre demande d'inscription sur yoyo.com a bien été enregistrée. Afin de la valider, veuillez cliquer sur le lien ci-dessous, ou le copier dans la barre d'adresses de votre navigateur internet:<br /><br />
			<a href=\"http://www.yoyo.com/valider_inscription.php?key=".$key."\">http://www.yoyo.com/valider_inscription.php?key=".$key."</a><br /><br />Cordialement,<br /><br />L'equipe de yoyo.com.";
 
			$entete = "MIME-Version: 1.0\r\n";
			$entete .= "Content-type: text/html; charset=iso-8859-1\r\n";
			$entete .= "From: yoyo@".$ip.".com\r\n";
	// email envoyé à l'admin
			mail("postmaster@yoyo.com",$sujet_admin,$msg_admin,$entete);  
 
			mail($email, $sujet, $msg, $entete);
			?>
			<script type="text/javascript">
			alert('Votre inscription a bien été enregistrée ! Un email contenant un lien de validation vous a été envoyé afin de valider votre inscription.');
			window.location='index.php';
			</script>
			<?
			die();
		}
	}
 
}