bzr branch
http://gegoxaren.bato24.eu/bzr/booka/newlayout
29.1.1
by gustav.hartvigsson
Fixed a parsing error, namly replaced all <? with <?php. |
1 |
<?php
|
11
by Gustav Hartvigsson
merging Neo to trunk. freezing neo branshs. |
2 |
session_start(); |
3 |
/*
|
|
4 |
login.php
|
|
5 |
*/
|
|
6 |
||
7 |
$username1 = $_POST[userName]; |
|
8 |
$password = md5($_POST[userPassword]); |
|
9 |
||
10 |
if($_POST[login] != true){ |
|
11 |
||
12 |
echo "<h1> That is not allowd!</h1>"; |
|
13 |
||
14 |
} else { |
|
15 |
include "./inc/dbConnect.php"; |
|
16 |
||
17 |
$query = "SELECT * FROM users WHERE username = '{$username1}';"; |
|
18 |
||
19 |
$userinfo = $db->query($query); |
|
20 |
||
21 |
$newinfo = $userinfo->fetch(); |
|
22 |
||
23 |
if($newinfo[password] == $password){ |
|
24 |
||
25 |
$_SESSION[logedin] = true; |
|
26 |
||
27 |
if($newinfo[group]==1){//check if user is admin. |
|
28 |
||
29 |
$_SESSION[admin] = true; |
|
30 |
||
31 |
}else{ |
|
32 |
||
33 |
$_SESSION[admin] = false; |
|
1
by Gustav Hartvigsson
initial code... |
34 |
|
35 |
}
|
|
36 |
||
11
by Gustav Hartvigsson
merging Neo to trunk. freezing neo branshs. |
37 |
sleep(.5); |
38 |
header('Location: ./BooKa.php'); |
|
39 |
||
40 |
}else { |
|
41 |
include "./inc/head.php"; |
|
42 |
||
24
by Gustav Hartvigsson
changed some stuff to use the CSS class 'warning'. |
43 |
echo "<h2 class='warning'>Password or Username does not match username.<br /> |
44 |
Klick <a href='./BooKa.php'> here </a> to return. </h2>"; |
|
11
by Gustav Hartvigsson
merging Neo to trunk. freezing neo branshs. |
45 |
|
46 |
include "./inc/foot.php"; |
|
1
by Gustav Hartvigsson
initial code... |
47 |
}
|
48 |
||
11
by Gustav Hartvigsson
merging Neo to trunk. freezing neo branshs. |
49 |
}
|
1
by Gustav Hartvigsson
initial code... |
50 |
?>
|