iframes war

This commit is contained in:
lopar 2018-03-24 00:39:39 +02:00
parent 7f42208b70
commit 3f96806855

View File

@ -6,19 +6,15 @@
*/ */
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if (!isset($_SESSION['uid'])) header("Location: index.php");
header("Location: index.php"); //include("config.php");
}
include("config.php");
$msg = filter_input(INPUT_POST,'msg'); //$msg = filter_input(INPUT_POST,'msg');
$uid = $_SESSION['uid']; //$uid = $_SESSION['uid'];
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); //if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
?> ?>
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Окно игры</title> <title>Окно игры</title>
<meta charset="utf-8"> <meta charset="utf-8">
@ -50,8 +46,8 @@ if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?
width: 15%; width: 15%;
padding: 10px; padding: 10px;
} }
.mainwrap { .mainwrap {
width: 800px;
height: 600px; height: 600px;
} }
@ -59,7 +55,10 @@ if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
iframe {border: none;}
iframe {
border: none;
}
</style> </style>
</head> </head>
@ -75,9 +74,9 @@ if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a> <a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
</header> </header>
<div class="mainwrap"> <div class="mainwrap">
<iframe name="main" src="main.php" width=100%></iframe> <iframe name="main" src="main.php"></iframe>
</div> </div>
<iframe name="chat" src="chat.php" width=100%></iframe> <iframe name="chat" src="chat.php"></iframe>
<footer> <footer>
<form action="chat.php" method="post" target="chat"> <form action="chat.php" method="post" target="chat">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение..."> <input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
@ -86,5 +85,3 @@ if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?
</footer> </footer>
</body> </body>
</html> </html>