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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
| <?php
require_once(DIR_INCLUDE . '/form.inc.php');
require_once(DIR_INCLUDE . '/recaptchalib.php');
setPageTitle('Inscription au site', true);
auth(VISITEUR,true,true);
function control_form() {
if (document.getElementById('pseudo').value==''){
alert("le pseudo doit être renseigné" );
return false; }
else {
return true;}
if (document.getElementById('password').value==''){
alert("le mot de passe doit être renseigné" );
return false; }
else {
return true;
if (document.getElementById('confirm').value==''){
alert("le mot de passe doit être le même" );
return false; }
else {
return true;}
if (document.getElementById('email').value==''){
alert("l'émail doit être renseigné" );
return false; }
else {
return true;}
if (document.getElementById('prenom').value==''){
alert("Votre prènom doit être renseigné" );
return false; }
else {
return true;}
if (document.getElementById('date').value==''){
alert("Votre date de naissance doit être renseigné" );
return false; }
else {
return true;}
if (document.getElementById('sexe').value==''){
alert("Votre sexe doit être renseigné" );
return false; }
else {
return true;}
}
}
// on vérifie si le captcha est bon
privatekey = "6LdiAskSAAAAACtuBwMoKnSGe-ZDKRSR67X_jZy8";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid)
{
// Le captcha EST INVALIDE !!
}
{
$req = $pdo->prepare('REQUETE WHERE id = :id');
$req->execute(array('id', $membre_id));
}
else
{
// ici on affiche ton formulaire
?>
<script type="text/javascript">
var RecaptchaOptions = { theme : 'custom', custom_theme_widget: 'recaptcha_widget', lang : 'fr' };
</script>
<h1>Inscription au site</h1>
<p style="text-align: center;"><strong>Vous devez remplir touts les champs avant de soumettre le formulaire.</strong></p>
<form method="post" action="<?php echo getLienModule('membre', 'inscription'); ?>">
<div id="tooltip"></div>
<p><label for="pseudo">Nom d'utilisateur :</label> <input type="text" name="pseudo" id="pseudo" onkeyup="verifPseudo(this.value)" /> <img src="../images/help.png" alt="" onmouseover="tooltip.show(this)" onmouseout="tooltip.hide(this)" title="Vous ne pouvez pas modifier votre nom d'utilisateur après l'inscription." /> <span class="boxVerif" id="pseudobox"></span></p>
<p><label for="password">Mot de passe :</label><input type="password" name="password" id="password" /></p>
<p><label for="confirm">Confirmer le mot de passe :</label><input type="password" name="confirm_mdp" id="confirm" /></p>
<p><label for="email">Votre adresse courriel :</label> <input type="text" name="email" id="email" onkeyup="verifEmail(this.value)" /> <span class="boxVerif" id="emailbox"></span></p>
<p><label for="mailyes">Rendre votre adresse courriel publique ?</label> <input type="radio" name="mail" id="mailyes" value="oui" /> <label for="mailyes" style="float: none; font-weight: normal;">Oui</label>
<input type="radio" name="mail" id="mailno" value="non" checked="checked" /> <label for="mailno" style="float: none; font-weight: normal;">Non</label> <img src="../images/help.png" alt="" onmouseover="tooltip.show(this)" onmouseout="tooltip.hide(this)" title="Vous pouvez changez ce paramètre à tout moment dans votre profil." /></p>
<p><br /><label for="prenom">Votre prénom :</label> <input type="text" name="prenom" id="prenom" /> <img src="../images/help.png" alt="" onmouseover="tooltip.show(this)" onmouseout="tooltip.hide(this)" title="Vous ne pouvez pas modifier ce champ après l'inscription." /></p>
<p><label>Date de naissance :</label>
<select name="dateN[0]" id="date">
<?php for($i=1;$i<=31;$i++)
{
if($i < 10)
$i = "0" . $i;
echo "\n<option value='".$i."'>".$i."</option>";
}
?>
</select> / <select name="dateN[1]">
<?php for($i = 1; $i <= 12; $i++)
{
$months = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'août', 'septembre', 'octobre', 'novembre', 'décembre');
echo "\n<option value='".$i."'>".$months[$i-1]."</option>";
}
?></select> / <select name="dateN[2]">
<?php for($i=1940;$i<=date("Y");$i++)
{
echo "\n<option value='".$i."'>".$i."</option>";
}
?>
</select>
<img src="../images/help.png" alt="" onmouseover="tooltip.show(this)" onmouseout="tooltip.hide(this)" title="Vous ne pouvez pas modifier ce champ après l'inscription." />
</p>
<p><label>Votre sexe :</label><input type="radio" name="sexe" value="homme" id="homme" /><label for="homme" style="float: none;"><img src="../images/male.png" alt="Homme" /></label> <input type="radio" name="sexe" value="femme" id="femme" /><label for="femme" style="float: none;"><img src="../images/female.png" alt="Femme" /></label> <img src="../images/help.png" alt="" onmouseover="tooltip.show(this)" onmouseout="tooltip.hide(this)" title="Vous ne pouvez pas modifier ce champ après l'inscription." /></p>
<p><label for="avatar">Avatar (facultatif) :</label><input type="file" name="avatar" id="avatar" /> (Taille maximale : 10 ko)</p>
<p><label> </label><input type="checkbox" name="newsletter" id="newsletter" /> <label for="newsletter" style="float: none;">Oui, je désire m'abonner à l'infolettre</label></p>
<?php // Recaptcha
$publickey = '6LdiAskSAAAAAPkrlIzLRZ8dHpeNjMI3Csrs6uwr';
?>
<div id="recaptcha_widget" style="display:none; margin-left: 230px;">
<div id="recaptcha_image"></div>
<div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect. Veuillez réessayer.</div>
<span class="recaptcha_only_if_image"><label for="recaptcha_response_field" style="float: none;">Veuillez recopier les mots ci-dessus :</label></span>
<span style="vertical-align: middle; display: inline-block;">
<a href="javascript:Recaptcha.reload()"><img src="../images/refresh.png" alt="" /></a>
<a href="javascript:Recaptcha.showhelp()"><img src="../images/help.png" alt="" /></a>
</span>
<br />
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
</div>
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=<?php echo $publickey; ?>">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=<?php echo $publickey; ?>"
height="300" width="500" frameborder="0"></iframe><br /><label> </label>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge" />
</noscript>
<br />
<br />
<label> </label><input type="submit" value="S'inscrire" OnClick="javascript:if(!control_form()) return false;" />
</form>
<?php // fin du formulaire et on ferme la condition pour le traitement + un méssage en disant veuillez vérifié dans votre boîte de mail afin de validé de validé votre inscription
}
?> |
Partager