saving php5 version

This commit is contained in:
Hausmeister 2017-10-31 19:16:46 +01:00
commit c2c1ee7b9b
46 changed files with 817 additions and 0 deletions

57
index.php Executable file
View file

@ -0,0 +1,57 @@
<?php
//show all errors
error_reporting (E_ALL);
ini_set("display_errors","TRUE");
//standart includes, vars and constants
$page="";
if (isset($_GET['page'])) $page=$_GET['page'];
$BODY = ""; //the page content
$ERROR = ""; //error messages
$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);
include("globals.php");
include("functions.php");
//User Login
if (!session_start()) $ERROR.="Server Session kann nicht eingerichtet werden, kein login m&ouml;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) {
$_SESSION['login']=$login;
}
else $ERROR.="Login nicht erfolgreich!<br>";
}
if ($page=="logout") {
$_SESSION['login']="";
$page="";
}
if (isset($_SESSION['login'])) define ("LOGIN",$_SESSION['login']);
else define ("LOGIN","");
if (LOGIN!="") {
$BODY.='<table class="list" width="100%"><tr><th style="text-align:left">'.add_icon('user')."&nbsp;&nbsp;".LOGIN."&nbsp;&nbsp;&nbsp;&nbsp;";
$BODY.='<a class="list" href="index.php?page=edit_game&to_do=new_game">'.add_icon("new_game").'Neues Spiel</a>';
$BODY.="</th></tr></table>";
}
$BODY.="<br><br>";
//include the requestet page
if ($page=="login") include ("login.php");
elseif ($page=="rank" ) include ("rank.php" );
elseif ($page=="games" ) include ("games.php" );
elseif ($page=="edit_game" ) include ("edit_game.php" );
elseif ($page=="poker_pott") include("poker_pott.php");
else include ("main.php");
//include the Template
include ("template.php");
//End of Script
mysql_close(DB);
?>