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

Размер файла: 891B
<?php
// Настройки базы
$db_host = "localhost";
$db_name = "cat";
$db_user = "cat";
$db_pass = "cat";

//Подключаемся к базе
@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("&amp;","$$","&#x27;","&quot;","&lt;","&gt;");
$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;}
?>