4
<title>Extreme Dating - Create User</title>
8
if(isset($_POST['hiddenStuff']) && $_POST['hiddenStuff'] == "Something Strange") {
9
$password = sha1($_POST['passwd']."salt");
10
//If there is a $_POST that indicates that the add userscript should be run.
12
if (isset($_SESSION['userType']) && $_POST['isSuperUser'] == true && $_SESSION['userType'] == 1) {
13
$query = "INSERT INTO Users (
26
'{$_POST['firstName']}',
27
'{$_POST['surName']}',
33
$query = "INSERT INTO Users (
45
'{$_POST['firstName']}',
46
'{$_POST['surName']}',
52
echo "<body> <h1> New user added! </h1> </body>";
59
<h1> Create a new user </h1>
61
<form action="./adduser.php" method="POST">
64
if(isset($_SESSION['userType']) && $_SESSION['userType'] == 1 ) {
65
//you are a superuser!
66
//you can add other superusers.
69
<td> <label for="user"> Is the user a Super User? </label> </td>
70
<td> <input type="checkbox" name="isSuperUser" id="super" \> </td>
76
<td> <label for="name"> User Name </label> </td>
77
<td> <input type="input" name="name" id="name" /> </td>
80
<td> <label for="passwd"> Password </label> </td>
81
<td> <input type="password" name="passwd" id="passwd" /> </td>
84
<td> <label for="firstname"> First Name </label> </td>
85
<td> <input type="input" name="firstName" id="firstname" /> </td>
88
<td> <label for="surname"> Sur Name </label> </td>
89
<td> <input type="input" name="surName" id="surname" /> </td>
92
<td> <label for="email"> E-mail </label> </td>
93
<td> <input type="input" name="eMail" id="email" /> </td>
96
<td> <label for="city"> City </label> </td>
97
<td> <input type="input" name="city" id="city" /> </td>
100
<td><input name="hiddenStuff" value="Something Strange" type="hidden"/></td>
101
<td><input id="input" type="submit" action="./adduser.php" value="Registera mig"/></td>