File size: 899B
<?php
// Настройки базы
$db_host = "localhost";
$db_name = "kategs";
$db_user = "kategs";
$db_pass = "nm234fry";
//Подключаемся к базе
@mysql_connect($db_host,$db_user,$db_pass) or die ("Can not connect to MySQL");
@mysql_select_db($db_name);
/////////////////////////////////////////////
function preobraz($value){
$value1=array("&","$","'","\"","<",">");
$value2=array("&","$$","'",""","<",">");
$value=str_replace($value1,$value2,$value);
if(get_magic_quotes_gpc()){
$value = stripslashes($value);}
$value = mysql_real_escape_string($value);
return $value;}
///////////////////////////////////////////
//Авторизация
function autorize() {
global $login, $pas;
$q = @mysql_query("select * from `users` where `admin`='$login' and `password`='$pas' limit 1;");
$sdata = @mysql_fetch_array($q);
return $sdata;}
?>