-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg.php
87 lines (50 loc) · 1.86 KB
/
reg.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
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Your Music-Decision</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="regstyle.css">
<script type="text/javascript">
function best() {
window.alert('Deine Party wurde registriert')
}
</script>
</head>
<body style="background-image: url(background.jpg)" >
<h1>Create a Party</h1><hr><br>
Gib hier den Namen deiner Party und das Passwort welches der Dj später benötigt ein :
<div id="main">
<form action="reg.php" method="post">
<input type="text" name="regpartyname" class="inpdes" value="Partyname">
<input type="text" name="regdjlog" class="inpdes" value="DJ Passwort">
<input type="submit" name="regbutt" class="inbutt" value="Registrieren" onclick="best()" >
</form>
</div>
<?php
require 'connection.php';
if(isset($_POST["regbutt"])){
$partyname = $_POST["regpartyname"];
$djlog= $_POST["regdjlog"];
$sql = 'INSERT INTO `reg_data`( `partyname`, `djlogin`) VALUES (:partyname, :djlog)';
$stmt = $dbh->prepare($sql);
$stmt->bindValue(':partyname',$partyname);
$stmt->bindValue(':djlog',$djlog);
$stmt->execute();
$partyname = $_POST["regpartyname"];
$xsql = "CREATE TABLE `db_369761_1`.`".$partyname."` ( `N_ID` INT(50) NOT NULL AUTO_INCREMENT , `Wunsch` VARCHAR(50) NOT NULL , `Interpret` VARCHAR(50) NOT NULL , `Datum` DATETIME NOT NULL, `upvote` INT(50) NOT NULL , PRIMARY KEY (`N_ID`)) ENGINE = InnoDB";
$xstmt = $dbh->prepare($xsql);
$xstmt->execute();
}
?>
<br>
<br>
<hr>
<div class="footer">
<p><b>oder</b> zurück zur vorherigen Seite : <br></p>
<form action='main.php' method='post'>
<input type='submit' name='logout' value='Back' id="backbutt" class="inbutt">
</form>
</div>
</body>
</html>