index.php:
<?php
include ("incl/head.html");
?>
Main.php:
<?php
if (!isset($Nick)) {
header("Location: ../");
}
if (!isset($Pswd)) {
header("Location: ../");
}
$connect=mysql_connect("localhost", "root", "");
$db=mysql_select_db("chat");
$query = mysql_query("select * from users where Nick='$Nick' and Pswd='$Pswd'", $connect);
while($myrow=mysql_fetch_row($query)){
$Login_Nick=$myrow[0];
$Login_Pswd=$myrow[1];
}
if (!isset($Login_Nick)) {
header("Location: error.php");
}
if (!isset($Login_Pswd)) {
header("Location: error.php");
}
else{
$set_Online=mysql_query("update users set online='1' Where Nick='$Nick'");
}
mysql_close();
?>
<html>
<head>
<title>Малаховская болталка</title>
<frameset cols="*,150" border="1">
<frameset rows="*,100">
<frame src="body.php">
<frame src="insert.php">
</frameset>
<frame src="users.php">
</frameset>
</head>
</html>
insert.php:
<?php
$connect=mysql_connect("localhost", "root", "");
$db=mysql_select_db("chat");
$mess = mysql_query("insert into body(Nick,messages) values('$nickname','$mess')", $connect);
mysql_close();
?>
<form action="" method="post">
<table align="center" border="0" width="500">
<tr>
<td><input type='text' name='mess' style='BORDER: #000000 1px solid; width: 380px; height: 20px;'></td>
<td><input type='submit' value='Сказать' style='BORDER: #000000 1px solid; width: 100px; height: 20px;'></td>
</tr>
</table>
<table align="center" border="0" width="500">
<tr>
<td>
<input type='button' value='Улыбочки' style='BORDER: #000000 1px solid; width: 70px; height: 20px;'>
<input type='button' value='Выход' style='BORDER: #000000 1px solid; width: 50px; height: 20px;'>
</td>
</tr>
</table>
</form>