Show sourcecode
The following files exists in this folder. Click to view.
bacon-egg-pizza.php
cquiz.php
create-account.php
create-account111.php
create-quiz.php
create-quiz2.php
createaccount.php
delete-quiz.php
drop-rps-tables.php
legacy-code-rps.php
legacy-index.php
login.php
logincheck.php
newpassword-verify.php
newpassword.php
potential-code.txt
quiz-db-init.php
quizhub.php
quizhub2.php
results.php
rpsaccount-ajax-user-search.php
rpsaccount.php
rpsbetting-ajax-match-finder.php
rpsbetting.php
rpsbettingleaderboard.php
rpschangepassword.php
rpschangepassword.txt
rpsgame-ajax.php
rpsgame.php
rpsgameresults.php
rpshostnewgame.php
rpshub.php
rpsleaderboard.php
rpslib.php
rpslogin.php
rpsmaininclude.php
rpsproject/
rpsusersearch.php
table-init.php
verification.php
create-account111.php
58 lines UTF-8 Windows (CRLF)
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
<?php
require("../incl/dbconnection.php");
if (isset($_POST['name']) && ($_POST['name']!=NULL) && isset($_POST['pass']) && ($_POST['pass']!=NULL)){
$useristaken = false;
$sql = "SELECT * FROM qusers";
$stmt = $dbconn -> prepare($sql);
$stmt -> execute();
while($res = $stmt->fetch(PDO::FETCH_ASSOC)){
if($res['name'] == $_POST['name']){
$useristaken = true;
}
}
if($useristaken == false){
$sql = "INSERT INTO qusers (username, pass, isadmin) VALUES (?,?, 1)";
$stmt = $dbconn -> prepare($sql);
$data = [$_POST['name'], $_POST['pass']];
$stmt -> execute($data);
header('Location:login.php');
}
else{
echo "username already taken";
}
}
?>
<html>
<h1>Skapa adminkonto</h1>
<form action="create-account111.php" method="POST">
<table>
<tr>
<td>
Användarnamn:
</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>
Lösenord:
</td>
<td>
<input type="text" name="pass">
</td>
</tr>
<tr>
<td>
<input type="submit" >
</td>
</tr>
</table>
</form>
</html>