-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvote_post.php
39 lines (39 loc) · 1.13 KB
/
vote_post.php
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
<?php
session_start ();
try
{
$bdd = new PDO('mysql:host=localhost;dbname=lisopfr_membre', 'lisopfr', 'hRkrKDkDy6');
}
catch (Exeption $e)
{
die('Erreur :' .$e->getMessage());
}
if ($_POST['cool'] == 'cool' ){
$bdd->exec('UPDATE preli SET cool = cool+1 WHERE id = 1');
}
if ($_POST['beau'] == 'beau' ){
$bdd->exec('UPDATE preli SET beau = beau+1 WHERE id = 1');
}
if ($_POST['sape'] == 'sape' ){
$bdd->exec('UPDATE preli SET sape = sape+1 WHERE id = 1');
}
if ($_POST['dejante'] == 'dejante' ){
$bdd->exec('UPDATE preli SET dejante = dejante+1 WHERE id = 1');
}
if ($_POST['simpa'] == 'simpa' ){
$bdd->exec('UPDATE preli SET simpa = simpa+1 WHERE id = 1');
}
if ($_POST['intel'] == 'intel' ){
$bdd->exec('UPDATE preli SET intel = intel+1 WHERE id = 1');
}
if ($_POST['seduc'] == 'seduc' ){
$bdd->exec('UPDATE preli SET mignon =mignon+1 WHERE id = 1');
}
if ($_POST['ouf'] == 'ouf' ){
$bdd->exec('UPDATE preli SET sadick = sadick+1 WHERE id = 1');
}
else
{ header('Location: Categos.php'); }
header('Location: Categos.php');
$_SESSION['vote'] = 2;
?>