Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://genphys.phys.msu.su/mikromag/script/phorum.php3
Дата изменения: Mon Nov 1 03:19:53 2010 Дата индексирования: Mon Oct 1 22:10:58 2012 Кодировка: Windows-1251 |
require("./auth.php3");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
//header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
//header("Cache-Control: no-cache, must-revalidate");
//header("Pragma: no-cache");
error_reporting(15);
//////////////////
// за работу форумов
//
define("DBName","mikromag");
define("HostName","localhost");
define("UserName","counter");
define("Password","counter");
if(!mysql_connect(HostName,UserName,Password))
{ echo "Ошибка! Не могу соединиться с базой ".DBName."!
"; exit; }
//******************
//* combines the two above functions for ease of use
//* in some circumstances
function pDateTime($unixtime)
{ $year= substr($unixtime,0,4);
$month=substr($unixtime,4,2);
$day=substr($unixtime,6,2);
$hour=substr($unixtime,8,2);
$min=substr($unixtime,10,2);
$sec=substr($unixtime,12,2);
$res=$day."-".$month."-".$year." ".$hour.":".$min.":".$sec;
return $res;
}
//**************
//* make some changes for all element of array
//* if some element of aray is array1 - make the same changes for all elements of array1
function obrMas($mas)
{
for(@reset($mas);
@$key=key($mas);
next($mas))
{
$elem = $mas[$key];
if (is_array($elem)==true)
{
obrMas($elem);
}
else
{
$t = addslashes($mas[$key]);
$t=strip_tags($t);
//$this=htmlspecialchars($this);
$t=trim($t);
$mas[$key] = $t;
}
}
}
@obrMas($HTTP_GET_VARS);
@obrMas($HTTP_POST_VARS);
//*****************************
// return 0 - error !=0 OK
function ftake_id_on_login($login,$password)
{
$s="select * from treg where login='$login' and password='$password'";
// echo "$s
";
$res=mysql(DBName,$s);
if (mysql_errno()<>0) {echo mysql_errno().": ".mysql_error()."
Ошибка
чтения!"; exit;}
if (mysql_num_rows($res)!=1)
{
return 0;
}
$ff=mysql_fetch_array($res);
return $ff['id'];
}
//*************
//* main class -
class cl_phorum
{
var $login,$password,$treg_id,$action,$tem_id,$tsb_id;
//***************
//** return top of the page
function top()
{
?>