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
createaccount.php
77 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
require("../incl/dbconnection.php");
if (isset($_POST['name']) && ($_POST['name']!=NULL) && isset($_POST['pass']) && ($_POST['pass']!=NULL) && isset($_POST['email'])){
$useristaken = false;
$sql = "SELECT * FROM rpsusers";
$stmt = $dbconn -> prepare($sql);
$stmt -> execute();
while($res = $stmt->fetch(PDO::FETCH_ASSOC)){
if($res['username'] == $_POST['name']){
$useristaken = true;
}
}
if($useristaken == false){
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
//ADD eMAIL!!!!!
$sql = "INSERT INTO pendingusers (username, pass, email, emailkey, regtime) VALUES (?,?,?,?,?)";
$stmt = $dbconn -> prepare($sql);
$emailkey = rand(100000,1000000);
$data = [$_POST['name'], $_POST['pass'], $_POST['email'], $emailkey, time()];
$stmt -> execute($data);
$name = $_POST['name'];
mail($_POST['email'], "account email verification", "https://labb.vgy.se/~leown/webbsrvprg/projects/verification.php?key=$emailkey&username=$name", 'verification email');
echo "check email inbox";
}
else{
echo "Invalid email format";
}
}
else{
echo "username already taken";
}
}
?>
<html>
<h1>Skapa konto</h1>
<form action="createaccount.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>
E-mail:
</td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<td>
<input type="submit" >
</td>
</tr>
</table>
</form>
</html>