forked from sennluzi/Pfadinet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
softcheck.php
46 lines (46 loc) · 1.31 KB
/
softcheck.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
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<?php
session_start();
error_reporting(0);
$_SESSION['status'] = "";
$status = $_SESSION['status'];
$username = $_SESSION['username'];
$password = $_SESSION['password'];
$verbindung = mysql_connect("localhost", "###USERNAME###","###PASSWORD###");
if(!$verbindung) {
$_SESSION['report'] = "Es konnte keine Verbindung zur Datenbank hergestellt werden";
echo "<meta http-equiv='refresh' content='0; URL=index.php?s=login'>";
exit;
}
else {
$datenbank = mysql_select_db("###DB_NAME###");
if(!$datenbank) {
$_SESSION['report'] = "Die Datenbank existiert nicht";
echo "<meta http-equiv='refresh' content='0; URL=index.php?s=login'>";
exit;
}
else {
$abfrage = "SELECT username, password, status FROM members";
$ergebnis = mysql_query($abfrage);
$log = "false";
while($row = mysql_fetch_object($ergebnis))
{
if($row->username == $username && $row->password == $password) {
$log = "true";
$status = $row->status;
}
}
if($log == "true") {
$_SESSION['status'] = $status;
}
else {
$username = "";
$password = "";
$status = "";
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
$_SESSION['status'] = $status;
}
}
}
?>