Просмотр файла head.php

Размер файла: 1.61Kb
<?
$starttime=microtime(1); 
include("bd.php");
include 'function.php'; 
require 'auth.php';
antihack ();
if(isset($_SESSION['user_id']))$me=mysql_fetch_array(mysql_query("SELECT * FROM `sh_user` WHERE id=$_SESSION[user_id]"));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MYFORUM.IN</title>
<? if(!isset($dir))echo '<link href="style.css" rel="stylesheet" type="text/css" />';
else echo '<link href="../style.css" rel="stylesheet" type="text/css" />';
?>
</head>
<body>


<div class="header"><font color="#000000">MY</font>FORUM.IN<br>

</div>
<div class="rekl">
Реклама
</div>
<?
if(isset($me)){$mails=mysql_num_rows(mysql_query("SELECT * FROM `sh_ls` WHERE `to`='$me[login]' AND `chit`='0'"));
if($mails!=0)echo "<img src='images/mail.gif'><a href='mail.php'>Личная почта</a>(".$mails.")<br/>";
$date=date("ndHis"); 
mysql_query ("UPDATE `sh_user` SET `time`='$date'  WHERE `id`='$me[id]' LIMIT 1");
}


else
{$date=date("ndHis");
$us_agent=mysql_real_escape_string(trim(htmlspecialchars(stripslashes($_SERVER['HTTP_USER_AGENT']))));
$ip=mysql_real_escape_string(trim(htmlspecialchars(stripslashes($_SERVER['REMOTE_ADDR']))));
if(mysql_num_rows(mysql_query("SELECT * FROM `sh_online` WHERE `ip`='$ip'"))==0 )mysql_query("INSERT INTO `sh_online`
SET `ip`='$ip',`ua`='$us_agent', `time`='$date'");
else mysql_query("UPDATE `sh_online` SET `time`='$date' WHERE `ip`='$ip'");
}


?>