-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacollection.php
More file actions
102 lines (83 loc) · 2.11 KB
/
Copy pathmacollection.php
File metadata and controls
102 lines (83 loc) · 2.11 KB
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
<?php
//RECUPERATION DES VARIABLES DE SESSION
session_start();
include_once('cookie_connect.php');
try
{
//CONNEXION BDD
$bdd = new PDO('mysql:host=localhost;dbname=phplogin', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
//TEST: VERIFICATION QUE LA VARIABLE ID EXISTE ET SUPERIEUR A 0
if(isset($_GET['id']) AND $_GET['id'] > 0)
{
//SECURISER LA VARIABLE CONVERSION DE CE MET L'UTILISATEUR EN NOMBRE
$getid = intval($_GET['id']);
//REQUETE: SELECTIONNE LES INFORMATIONS DE L'UTILISATEUR CONNECTE
$requser = $bdd->prepare("SELECT * FROM users WHERE id ='$getid'");
$requser->execute(array($getid));
//(fetch()): FONCTION QUI RECUPERE LES INFOS PROPPRE A L'UTILISATEUR CONNECTE
$userinfo = $requser->fetch();
//REQUETE: SELECTIONNE DANS L'ORDRE DECROISSANT TOUTES LES PHOTOS OU LE PROPRIETAIRE DE LA PHOTO CORRESPOND A L'UTILISATEUR CONNECTE
$photos = $bdd->query("SELECT * FROM photo WHERE proprio='$getid' ORDER BY id DESC");
?>
<!DOCTYPE html>
<html>
<head>
<title> AMSTRAGRAM </title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="macollection.css"/>
</head>
<body>
<!--barre du haut-->
<h3> AMSTRAMGRAM </h3>
<h6> Bour et Bour et Ratatam !</h6>
<!--MENU-->
<nav>
<ul>
<li>
<a href="ajouter.php">ajouter</a>
</li>
<li>
<a href="monfil.php">mon fil</a>
</li>
<li>
<a href="macollection.php" id="here">ma collection</a>
</li>
<li>
<a href="parametres.php">mes parametres</a>
</li>
<li>
<form method="POST" action="">
<input type="search" name="q" placeholder="rechercher" id="search"/>
<input type="submit" value="OK" id="search_button"/>
</form>
</li>
<li>
<a href="home.php">deconnexion</a>
</li>
</ul>
</nav>
<!--CHOIX ENTRE LA PAGE MES PHOTOS OU MES ALBUMS-->
<div id="choice">
<ul>
<li id="choice1">
<a href="mesimages.php">Mes Photos</a>
</li>
<li id="choice2">
<a href="mesalbums.php">Mes Albums</a>
</li>
</ul>
</div>
</body>
</html>
<?php
}
else
{
header("Location: macollection.php?id=".$_SESSION['id']);
}
?>