-
Notifications
You must be signed in to change notification settings - Fork 0
/
resulti.php
76 lines (46 loc) · 1.68 KB
/
resulti.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
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
<!DOCTYPE html>
<html>
<head>
<title>Your Music-Decision</title>
<link rel="stylesheet" type="text/css" href="resultistyle.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-image: url(background.jpg);">
<script type="text/javascript">
function buttonChange() {
document.getElementById('backbutt').style.background = "white";
document.getElementById('backbutt').style.color = "black";
document.getElementById("backbutt").style.cursor = 'crosshair';
}
function buttonBack() {
document.getElementById("backbutt").style.background='transparent';
document.getElementById("backbutt").style.color="white";
document.getElementById("backbutt").style.cursor='default';
</script>
<div id="main">
<?php
require 'connection.php';
//der Variable anyon wird der aus der URL ausgelesene Wert zugewiesen
$anyon=$_GET["anyon"];
$upzahl=$_GET["upsen"];
$andereID = $_GET["anyo"];
$dbname = $_GET["var"];
// jenachdem welcher Button gedrückt unterschiedlicher Wert welcher hier angesprochen wird
if (isset($_POST[$andereID]))
{
$upzahl=$upzahl+1;
$sql = "UPDATE `$dbname` SET `upvote` = '$upzahl' WHERE `$dbname`.`N_ID` = $anyon";
$stmt = $dbh->prepare($sql);
$stmt->bindValue(':upzahl',$upzahl);
$stmt->execute();
echo "<p>Deine Eingabe ist eingegangen</p>";
}
echo "<form action='vote.php?var=$dbname' method='post'>
<input type='submit' name='backbutt' id='backbutt' class ='inbutt' onmouseover='buttonChange()' onmouseleave='buttonBack()' value='Zurück '>
</form>
"
?>
</div>
</body>
</html>