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
| <?php
include("fonctions.php");
include ( "inc1/header.html" ) ;
?>
<div id="menu">
<div class="element_menu">
<h3>Titre menu</h3>
<ul>
<li><a href="index1.php">Accueil</a></li>
<li><a href="livredor.php">Livre d'or</a></li>
<li><a href="inscription.php">S'inscrire</a></li>
</ul>
</div>
<div class="element_menu">
<h3>Titre menu</h3>
<ul>
<li><a href="page4.html">Lien</a></li>
<li><a href="page5.html">Lien</a></li>
<li><a href="page6.html">Lien</a></li>
</ul>
</div>
</div>
<div id="corps">
<CENTER><TABLE width=500px>
<FORM name='inscription' method='POST' action='inscription.php'>
<TR><TD width=100%> Entrez votre identifiant</TD>
<TD><INPUT type='text' size=40 name='identifiant' value='<?php if (isset($identifiant)) echo $identifiant?>'></TD><BR>
<TR><TD width=100%> Entrez votre mot de passe </TD>
<TD><INPUT type='password' size=40 name='mot_de_passe' value='<?php if (isset($identifiant)) echo $mot_de_passe?>'></TD><BR>
<TR><TD width=100%> Entrez votre nom</TD>
<TD><INPUT type='text' size=40 name='nom' value='<?php if (isset($identifiant)) echo $nom?>'></TD><BR>
<TR><TD width=100%> Entrez votre prenom </TD>
<TD><INPUT type='text' size=40 name='prenom' value='<?php if (isset($identifiant)) echo $prenom?>'></TD><BR>
<TR><TD width=100%> Entrez votre adresse mail</TD>
<TD><INPUT type='text' size=40 name='adresse' value='<?php if (isset($identifiant)) echo $adresse?>'></TD><BR>
<TR><TD colspan = 2 align='center'><INPUT type='submit' type=submit name='inscription' onclick='cryptage();' value='Inscription'>
</TD><br><br>
</TR>
</TABLE>
</CENTER>
</div>
<?php
if(isset($_POST['identifiant'])){
$identifiant=$_POST['identifiant'];
$rqt="Select identifiant from utilisateur where identifiant='".$identifiant."';";
$resultat=pg_fetch_array(requete($rqt));
if($identifiant!=$resultat[0]){
$code=md5(round(0,32).time());
$rqt="Insert into utilisateur(identifiant,mot_de_passe,nom,prenom,adresse,id_type,numero_a)
values('".$_POST['identifiant']."',
'".$_POST['mot_de_passe']."',
'".$_POST['nom']."',
'".$_POST['prenom']."',
'".$_POST['adresse']."',
'".(2)."',
'".$code."');";
$res = requete($rqt);
$headers ='From: "Administration"<administrateur@ifide.com>'."\n";
$headers .='Reply-To: ludovic.rippinger@orange.fr'."\n";
$headers .='Content-Type: text/html; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';
$message ="<html><head><title>Activation de votre compte</title></head>
<body>
<b> Bienvenue , et merci de vous êtes inscrit.
Pour valider votre inscription , cliquez sur le lien ci-dessous </br>
<a href='http://localhost/forum/validation.php?user=".$_POST['identifiant']."&code=".$code."'>Activation</a>
</body></html>";
if(mail($_POST['adresse'], 'Activation de votre compte', $message, $headers))
{
echo 'Le message a été envoyé';
}
else
{
echo 'Le message n\'a pu être envoyé';
}
}else{
echo ("<center><FOnt color = red>Ce pseudonyme est déja utilisé</font></center>");
}
}
?>
<?php
include ( "inc1/footer.html" ) ;
?> |
Partager