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
| <!-- page d'inscription - maj d'un membre -->
<?php
if($_POST['pseudo'] !="")
{
setcookie('pseudo', $_POST['pseudo'], time() + 365*24*3600, null, null, false, true);
}
require_once("./menu_onglets.php");
$menu = affiche_menu();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Aventures en Bretonnie !</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Warhammer" href="CSS-Bretonnie.css" /> <!-- feuille de style -->
</head>
<body>
<?php
include ("./entete.php");
echo $menu;
if (($_POST['pseudo']=="") OR ($_POST['password']==""))
{ ?>
<form method="post" action="member.php" id="profil">
<fieldset > <legend><strong> Profil du Membre</strong></legend><br />
<img src="./Images/blackorc.jpg" alt="Orc" id="ImageProfil">
<label for="pseudo"> Pseudo: </label><input type="text" name="pseudo" id="pseudo" /><br /><br />
<label for="password"> Password: </label><input type="password" id="password" name="password" /><br /><br />
<label for="sex"> Sexe: </label>
<input type="radio" name="sex" value="masculin" id="masculin" checked="checked" /> <label for="masculin">Masculin</label>
<input type="radio" name="sex" value="feminin" id="feminin" /> <label for="feminin">Féminin</label><br /><br />
<label for="place"> Ville: </label><input type="place" id="place" name="place" /><br /><br />
<label for="race"> Race: </label><select name="race" >
<option value="" selected="selected"></option>
<option value="Humain">Humain</option>
<option value="Nain">Nain</option>
<option value="Elfe">Elfe</option>
<option value="Demi-Elf">Demi-Elf</option>
</select><br /><br /><br /><br />
<input type="reset" value="Annuler"/>
<input type="submit" value="Valider" />
</fieldset>
</form>
<?php }
else {
try // connexion à la BDD MySQL
{
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=mysql.60free.ovh.org;dbname=politiclub', 'politiclub', 'jolie408', $pdo_options);
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
$req = $bdd->prepare('INSERT INTO membres (pseudo, password, place, race) VALUES (?,?,?,?)');
$req->execute(ARRAY($_POST['pseudo'], $_POST['password'], $_POST['place'], $_POST['race']));
?>
<div id="profil">
<?php
echo '<h1>Bienvenue à toi Noble <em><strong>'.$_POST['pseudo'].'</strong></em></h1> ';
echo ' <h2> <a href="MembersList.php" >Clickez pour voir la liste </a></h2>';
?>
</div>
<?php } ?>
</body>
</html> |
Partager