Новое игровое окно.

This commit is contained in:
lopar 2018-03-22 21:32:48 +02:00
parent a28bb61c05
commit bff129f7b7
2 changed files with 87 additions and 9 deletions

View File

@ -10,12 +10,11 @@ if ($_SESSION['uid'] == null) {
header("Location: index.php");
}
include_once "config.php";
include_once "functions.php";
//include_once "functions.php";
$msg = filter_input(INPUT_POST,'msg');
$uid = $_SESSION['uid'];
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
//$msg = filter_input(INPUT_POST,'msg');
//$uid = $_SESSION['uid'];
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
function show_messages()
{
@ -42,8 +41,8 @@ function show_messages()
<div>
<?php show_messages(); ?>
</div>
<form action="chat.php" method="post">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
<input type="submit" value="Отправить">
</form>
<!--<form action="chat.php" method="post">-->
<!-- <input id="msg" name="msg" size="100" placeholder="Введите сообщение...">-->
<!-- <input type="submit" value="Отправить">-->
<!--</form>-->
</body>

79
game.php Normal file
View File

@ -0,0 +1,79 @@
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
session_start();
if (!isset($_SESSION['uid'])) {
header("Location: index.php");
}
include("config.php");
$msg = filter_input(INPUT_POST,'msg');
$uid = $_SESSION['uid'];
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
?>
<!doctype html>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<style>
header,
footer {
display: block;
margin: 5px;
padding: 2px;
border: 1px solid #eebb55;
border-radius: 7pt;
background: #ffeebb;
text-align: center;
}
form {
padding: 3px;
width: 100%;
}
form input {
border: 1px solid silver;
padding: 10px;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
padding: 10px;
}
</style>
</head>
<body>
<header>
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
<a href="/give.php" title="Передачи" target="main"><img src="http://placehold.it/32x32/ff3333?text=G"/></a>
<a href="/klan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
<a href="/orden.php" title="Особые умения" target="main"><img src="http://placehold.it/32x32/33ff33?text=O"/></a>
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
</header>
<iframe name="main" src="main.php" width=100%></iframe>
<iframe name="chat" src="chat.php" width=100%></iframe>
<footer>
<form action="chat.php" method="post">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
<input type="submit" value="Отправить">
</form>
</footer>
</body>
</html>