IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

[Mail] Problème d'e-mail de confirmation [Débutant(e)]


Sujet :

Langage PHP

  1. #1
    Futur Membre du Club
    Inscrit en
    Décembre 2006
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Décembre 2006
    Messages : 8
    Points : 7
    Points
    7
    Par défaut [Mail] Problème d'e-mail de confirmation
    Bonjour à tous ! Je suis Webmaster d'un site, mais j'ai un petit problème. Lors de l'inscription, tout marche bien, jusqu'au moment du mail de confirmation. On me dit que le mail est parti, mais je ne reçois rien. Ca me fait pareil pour la récupération d'un mot de passe. Enfait, tout ce qui touche l'e-mail ne marche pas. Résultat: Je ne peux pas valider mon inscription, donc, pas me connecter à la page membre... Avez vous une solution ?

    L'addresse du site est: FSDownload

    Par la même occasion, vous voyez que ma page n'est pas centré et qu'un petit bout est coupé, avez vous une solution pouré réparer ça également?

    Merci de votre aide

    Ugo

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2003
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2003
    Messages : 50
    Points : 56
    Points
    56
    Par défaut
    Salut,

    Concernant ton problème de mail, il faudrait que tu postes les morceaux de code incriminés. Il est difficile de regler un problème sans voir le source.

    Sinon pour le centrage de ta page (qui passe sans problème sous Firefox, mais pas sous IE), en attendant de trouver mieux, tu modifier le BODY :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <BODY style=" text-align:center">

  3. #3
    Futur Membre du Club
    Inscrit en
    Décembre 2006
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Décembre 2006
    Messages : 8
    Points : 7
    Points
    7
    Par défaut
    Bonjour. Merci beaucoup de votre réponse. Mes codes sont:

    pdf_inscription.php
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>FS Download</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="header"><a name="haut" id="haut"></a><img src="images/header.jpg" width="785" height="170" /></div>
    <div id="menu" class="menu">
      <table width="700" height="32" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="60"><div align="center"><a href="index.html">Accueil</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="presentation.html">Présentation</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60" class="active"><div align="center">Inscription</div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="membres.html">Membres</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="forum.html">Forum</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="contact.html">Contact</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="pdf_connexion.php">Connexion</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="download.html">Téléchargement</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
        </tr>
      </table>
    </div>
    <div id="texteTop"><img src="images/texteTop.gif" width="785" height="37" /></div>
    <div id="texteBg">
      <table width="209" border="0" cellpadding="0" cellspacing="0" class="photosPositionnementcentre">
        <p class="titre"><img src="images/fleche.gif" alt="fleche" width="31" height="12" />Inscription</p>
          </table>
            <br />
            <br />
    <html><body><form name="form1" method="post" action="pdf_inscription2.php"><font color="#0080C0" face="Verdana">
    	Pseudo:<br>
        <input type="text" name="pseudo"><br>
    	Mot de Passe:<br>
        <input name="mdp" type="password" id="mdp"><br>
        Retapez votre mot de passe:<br>
        <input name="verif_mdp" type="password" id="verif_mdp"><br>
        Votre E-Mail:<br>
        <input name="mail" type="text" id="mail"><br>
        Nom:<br>
        <input name="nom" type="text" id="nom"><br>	
        Prenom:<br>
        <input name="prenom" type="text" id="prenom"><br>
        Site Web:<br>
        <input name="website" type="text" id="website"><br>
    	Pays:<br>
        <input name="pays" type="text" id="pays"><br>
        Date de Naissance (jj/mm/aa):<br>
        <input name="born" type="text" id="born"><br>	
        <input type="submit" name="Submit" value="Inscription">
      </form>
    </boby></html>
            <br /></td>
        </tr>
      </table>
    </div>
    <div class="textePetit" id="texteBas">Copyright &copy; 2006 Cabrol Ugo. Tous droits r&eacute;serv&eacute;s.</a></div>
    </body>
    </html>
    pdf_inscription2.php
    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
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>FS Download</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="header"><a name="haut" id="haut"></a><img src="images/header.jpg" width="785" height="170" /></div>
    <div id="menu" class="menu">
      <table width="700" height="32" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="60"><div align="center"><a href="index.html">Accueil</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="presentation.html">Présentation</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60" class="active"><div align="center">Inscription</div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="membres.html">Membres</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="forum.html">Forum</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="contact.html">Contact</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="pdf_connexion.php">Connexion</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="download.html">Téléchargement</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
        </tr>
      </table>
    </div>
    <div id="texteTop"><img src="images/texteTop.gif" width="785" height="37" /></div>
    <div id="texteBg">
      <table width="209" border="0" cellpadding="0" cellspacing="0" class="photosPositionnementcentre">
        <p class="titre"><img src="images/fleche.gif" alt="fleche" width="31" height="12" />Validation</p>
          </table>
            <br />
            <br />
    <?php
    session_start(); //On demarre une session parce que j'ai envi ^^
    require("conf.php3"); //On insert le fichier qui contient les informations
     
    $mail = htmlentities($_POST['mail']);
     
        if (preg_match("!^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$!", $mail)) //Verifie que l'email entrée n'est pas une fausse.
        {
    		$chaine = "abcdefghijklmnopqrstuvwxyz0123456789"; 
    		$confirm = str_shuffle($chaine); //On créé le code de confirmation
     
    		$pseudo = htmlentities($_POST['pseudo']); //On recupère les infos
    		$mdp = htmlentities($_POST['mdp']);
    		$verif_mdp = htmlentities($_POST['verif_mdp']);
    		$nom = htmlentities($_POST['nom']);
    		$prenom = htmlentities($_POST['prenom']);
    		$website = htmlentities($_POST['website']);
    		$pays = htmlentities($_POST['pays']);
    		$born = htmlentities($_POST['born']);
     
    		/*On Fait la variable contenant le mail de confirmation*/
     
    		$message1 = '<html><body>Bonjour ' . $pseudo . ' et bienvenue sur ' .$nom_site. '.</br>'; 
    		$message1 .= '</br>';
    		$message1 .= 'Vous venez de vous inscrire et nous sommes heureux<br>de pouvoir vous compter aujourd\'hui parmi nos membres.<br>'; 
    		$message1 .= 'Voici un rappel de vos identifiants, notez les précieusement : <br>';
    		$message1 .= 'Votre Pseudo :' . $pseudo .'.<br>';
    		$message1 .= 'Votre Mot de passe:' . $mdp .'.<br><br>';
    		$message1 .= 'Votre Mail:' . $mail .'.<br><br>';
    		$message1 .= 'Votre Nom:' . $nom .'.<br><br>';
    		$message1 .= 'Votre Prenom:' . $prenom .'.<br><br>';
    		$message1 .= 'Votre Pays:' . $pays .'.<br><br>';
    		$message1 .= 'Votre Site Web' . $website .'.<br><br>';
    		$message1 .= 'Votre Date de naissance:' . $born .'.<br><br>';									
    		$message1 .= 'Si vous souhaitez changer vos informations, rendez-vous dans votre compte pour les mettre à jour.<br>';
    		$message1 .= 'Votre Clé d\'activation:<br>';
       		$message1 .= '' .$url_script. '/confirm.php?login=' . str_replace(' ','%20',$pseudo) . '&confirm=' . $confirm . '<br><br>';
    		$message1 .= 'A très bientôt sur le site!<br>L\'équipe de ' .$nom_site. '.<br><a href="' .$url_site. '">' .$nom_site. '</a>';
     
    		$sql = connect_sql(); //On se connecte à MySQL
     
    		$verification = mysql_query("SELECT COUNT(*) FROM pdf_membre WHERE pseudo='$pseudo' OR mail='$mail'") or die (mysql_error());
    		$donnees = mysql_fetch_array($verification)or die (mysql_error());
     
    		if($donnees['COUNT(*)'] >= 1) //On verifie que le pseudo n'existe pas déjà
    		{ 
    			$reponse = 'Le pseudo ou l\'email est déjà utilisé, merci d\'en choisir un(e) autre. <a href="javascript:history.back(1)">Retour au formulaire</a>';
    		}
    		else
    		{	
    			if( empty($pseudo) || empty($mdp) || empty($verif_mdp) || empty($mail) || empty($nom) || empty($prenom) || empty($born)) //On verifie que les variables précédentes ne soient pas vide
    			{
    				$reponse = 'Un ou plusieurs champs ne sont pas remplis, <a href="javascript:history.back(1)">Retour au formulaire</a>';
    			}
    			elseif( $mdp != $verif_mdp) //On verifie que les 2 pass sont identiques
    			{
    				$reponse = 'Les mots de passe ne sont pas identiques, <a href="javascript:history.back(1)">Retour au formulaire</a>';
    			}
    			else //Si tout est bon on entre les données dans la BDD et on envoye le mail
    			{
    				mysql_query("INSERT INTO pdf_membre VALUES ('','$pseudo', '$mdp', '$mail', '$confirm', '$nom', '$prenom', '$pays', '$born', '$website')");
    				$reponse = 'Bravo, vous êtes maintenant inscrit sur ' .$nom_site. '. <br>Vous allez recevoir un e-mail pour activer votre compte. <br><a href="' .$url_site. '">Retour à l\'Accueil</a>';
    				$entete = "MIME-Version: 1.0\r\n";
    				$entete .= "Content-type: text/html; charset=iso-8859-1\r\n";
    				$entete .= "From: <$email_admin>\r\n";
    				$entete .= "Reply-To: $email_admin\r\n";
    				mail($mail,'Bienvenue sur ' .$nom_site. ' ' . $login .'.' , $message1, $entete);
    			}
    		}
     
    		mysql_close($sql); //On se deconnecte
    	}
    	else //Reponse si l'adresse e-mail est une fausse
    	{
    		$reponse = 'Votre adresse e-mail "' . $mail . '" n\'est pas correcte. <a href="javascript:history.back(1)">Retour au formulaire</a>';
    	} 	
     
     
     
     
    ?>
    <html>
    <body>
    <? echo $reponse; ?> <!-- On affiche la reponse de tout le code du dessus -->
    </body>
    </html>
            <br /></td>
        </tr>
      </table>
    </div>
    <div class="textePetit" id="texteBas">Copyright &copy; 2006 Cabrol Ugo. Tous droits r&eacute;serv&eacute;s.</a></div>
    </body>
    </html>

    Confirm.php
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>FS Download</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="header"><a name="haut" id="haut"></a><img src="images/header.jpg" width="785" height="170" /></div>
    <div id="menu" class="menu">
      <table width="700" height="32" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="60" class="active"><div align="center">Accueil</div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="presentation.html">Présentation</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="pdf_inscription.php">Inscription</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="membres.html">Membres</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="forum.html">Forum</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="contact.html">Contact</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="pdf_connexion.php">Connexion</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
          <td width="60"><div align="center"><a href="download.html">Téléchargement</a></div></td>
          <td width="22"><img src="images/menuSeparateur.gif" alt="sep" width="22" height="32" /></td>
        </tr>
      </table>
    </div>
    <div id="texteTop"><img src="images/texteTop.gif" width="785" height="37" /></div>
    <div id="texteBg">
      <p class="titre"><img src="images/fleche.gif" alt="fleche" width="31" height="12" />Confirmation</p>
      <table width="295" border="0" cellpadding="0" cellspacing="0">
      </table>
    </div>
    <?
    require("conf.php3");
     
    $sql = connect_sql();
     
    $search = 'SELECT COUNT(*) as nb FROM pdf_membre WHERE pseudo = "'.addslashes($_GET['login']).'" AND confirm = "'.addslashes($_GET['confirm']).'"';
    $req = mysql_query($search) or die(mysql_error());
    $data = mysql_fetch_array($req);
     
    if($data['nb'] == 1)
    {
    $login = $_GET['login'];
    mysql_query("UPDATE pdf_membre SET `confirm`='' WHERE `pseudo` ='$login'") or die('erreur : '.mysql_error()); 
     
    echo '<p>Votre compte à bien été créé.</p>';
    echo '<p>Pour retournez à la page d\'accueil cliquez <a href="' .$http://fsdownload.ifrance.com/. '">ici</a>.</p>';
    }
    else 
    {
    echo '<p>Un problème est survenu, il est possible que vous n\'êtes pas inscrit ou que l\'adresse est fausse ou que vous êtes déjà validé !.</p>';
    }
    mysql_close($sql);
    ?> 
    <div class="textePetit" id="texteBas">Copyright &copy; 2006 Cabrol Ugo. Tous droits r&eacute;serv&eacute;s.</a></div>
    </body>
    </html>

    Merci de vos réponses

    Ugo

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2003
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2003
    Messages : 50
    Points : 56
    Points
    56
    Par défaut
    Et les informations sont bien enregistrées dans la base de données?

    De même place peut-être une condition sur le mail() pour savoir s'il renvoi TRUE ou FALSE.

Discussions similaires

  1. [Mail] problème utilisation fonction mail()
    Par leclone dans le forum Langage
    Réponses: 3
    Dernier message: 20/02/2007, 18h05
  2. [Mail] Problème envoi e-mail format HTML
    Par Sayrus dans le forum Langage
    Réponses: 13
    Dernier message: 19/12/2006, 14h57
  3. [Mail] envoi d'un mail, problème avec gmail
    Par kitty2006 dans le forum Langage
    Réponses: 11
    Dernier message: 30/09/2006, 08h45
  4. [Mail] Problème d'e-mail
    Par temperature dans le forum Langage
    Réponses: 1
    Dernier message: 19/04/2006, 16h52
  5. [Mail] Problème de Fonction mail()
    Par goma771 dans le forum Langage
    Réponses: 6
    Dernier message: 14/02/2006, 17h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo