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
| <?php
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
if (!$cookie->isLogged())
Tools::redirect('authentication.php');
include(dirname(__FILE__).'/header.php');
//On récupère la valeur de nos variables passées par URL
$action = isset($_GET['action'])?htmlspecialchars($_GET['action']):'consulter';
$membre = isset($_GET['m'])?(int) $_GET['m']:'';
//On regarde la valeur de la variable $action
switch($action)
{
case "consulter":
// On se connecte à MySQL
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=localhost;dbname=prestashop', 'root', 'root', $pdo_options);
// On récupère tout le contenu de la table jeux_video
$reponse = $bdd->query('SELECT * FROM ps_customer');
$data = $reponse->fetch($_GET['m']);
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
echo '<p><i>Vous êtes ici</i> : <a href="./index.php">Index</a> -->
profil de '.stripslashes(htmlspecialchars($data['firstname']));
echo'<h1>'.stripslashes(htmlspecialchars($data['firstname'])).'</h1><br />';
echo'<img src="./img/avatars/'.$data['membre_avatar'].'"
alt="Ce membre n a pas d avatar" /><br /><br />';
echo'Registered since :
<strong>'.date($data['date_add']).'</strong>
<br /><br />';
echo'<p><strong>Birthday : </strong>
'.stripslashes(htmlspecialchars($data['birthday'])).'<br />';
echo'<strong>Lieu : </strong>'.stripslashes(htmlspecialchars($data['membre_localisation'])).'
</p>';
}
$reponse->closeCursor(); // Termine le traitement de la requête
}
include(dirname(__FILE__).'/footer.php');
?> |
Partager