save current state
This commit is contained in:
parent
c2c1ee7b9b
commit
64d4eeb85d
9 changed files with 116 additions and 97 deletions
18
index.php
18
index.php
|
|
@ -11,8 +11,7 @@
|
|||
$COMMENT = ""; //comments
|
||||
if (isset($_GET['to_do'])) define ("TO_DO",$_GET['to_do']);
|
||||
else define ("TO_DO","");
|
||||
define ('DB',mysql_connect("localhost","poker","JuzFQK6rnNfx75v8"));
|
||||
mysql_select_db("poker",DB);
|
||||
$db = mysqli_connect("localhost","poker","*******", "poker");
|
||||
include("globals.php");
|
||||
include("functions.php");
|
||||
|
||||
|
|
@ -20,13 +19,13 @@
|
|||
if (!session_start()) $ERROR.="Server Session kann nicht eingerichtet werden, kein login möglich!<br>";
|
||||
if (TO_DO=="login") {
|
||||
$login=$_POST['login'];
|
||||
$password=md5($_POST['password']);
|
||||
$query=mysql_query("SELECT `password` FROM `player` WHERE `alias` = '$login' AND `password` IS NOT NULL LIMIT 0 , 30",DB);
|
||||
$data=mysql_fetch_array($query);
|
||||
if ($data['password']==$password) {
|
||||
$query=mysqli_query($db, "SELECT `password` FROM `player` WHERE `alias` = '$login' AND `password` IS NOT NULL LIMIT 0 , 30");
|
||||
$data=mysqli_fetch_array($query);
|
||||
if ($data!==NULL && $data!==False && password_verify($_POST['password'], $data['password'])) {
|
||||
$_SESSION['login']=$login;
|
||||
} else {
|
||||
$ERROR.="Login nicht erfolgreich!<br>";
|
||||
}
|
||||
else $ERROR.="Login nicht erfolgreich!<br>";
|
||||
}
|
||||
if ($page=="logout") {
|
||||
$_SESSION['login']="";
|
||||
|
|
@ -36,7 +35,8 @@
|
|||
else define ("LOGIN","");
|
||||
if (LOGIN!="") {
|
||||
$BODY.='<table class="list" width="100%"><tr><th style="text-align:left">'.add_icon('user')." ".LOGIN." ";
|
||||
$BODY.='<a class="list" href="index.php?page=edit_game&to_do=new_game">'.add_icon("new_game").'Neues Spiel</a>';
|
||||
$BODY.='<a class="list" href="index.php?page=edit_game&to_do=new_game">'.add_icon("new_game").'Neues Spiel</a> ';
|
||||
$BODY.='<a class="list" href="index.php?page=rank&to_do=update_rank">'.add_icon("arrow_out").'Rangliste Aktualisieren</a> ';
|
||||
$BODY.="</th></tr></table>";
|
||||
}
|
||||
$BODY.="<br><br>";
|
||||
|
|
@ -53,5 +53,5 @@
|
|||
include ("template.php");
|
||||
|
||||
//End of Script
|
||||
mysql_close(DB);
|
||||
mysqli_close($db);
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue