<?php
  ///////////////////////////////////////////////////
  //Домашняя библиотека,
  //Клиентская часть
  //2008 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $dblocation = "localhost"; // адрес mysql сервера
  $dbport = "3306"; // порт mysql сервера
  $dbname = "db_library"; // имя базы данных
  $dbuser = "library_admin"; // логин
  $dbpasswd = "Pgt7d34smb9"; // пароль
  $usr_pass="12"; //кол-во символов в пароле для пользователей

  $dbcnx = mysqli_connect($dblocation,$dbuser,$dbpasswd,$dbname);
  if(!$dbcnx)
  {
    echo "<html>
            <head>
            <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
            <link rel='StyleSheet' type='text/css' href='../skins/base/reader.css' />
            <link rel='icon' href='../favicon.ico' type='image/x-icon' />
            <link rel='shortcut icon' href='../favicon.ico' type='image/x-icon' />
            <title>".$TEXT['global-title']."</title>
            </head><body>
            <table align='center' width='95%' border='0' cellspacing='0' cellpadding='0'>
            <tr><td width='16'>&nbsp;</td><td></td><td width='16'>&nbsp;</td></tr>
            <tr><td class='osn_top_r'></td><td class='osn_top'></td><td class='osn_top_l'></td></tr>
            <tr><td class='osn_left'>&nbsp;</td><td class='osn_center'><table align='center' border='0'><tr align='center' ><td><img alt='stop' src='../skins/base/stop.png' /></td></tr><tr  align='center' ><td><span class='bold_it'>".$TEXT['error-conf2']."</span></td></tr></table><td class='osn_right'>&nbsp;</td></tr>
            <tr><td class='osn_bottom_r'></td><td class='osn_bottom'></td><td class='osn_bottom_l'></td></tr>
            </table></body></html>";
    exit();
  }
  mysqli_query($dbcnx,"SET CHARACTER SET 'utf8'") or exit('SET CHARACTER SET error');
  mysqli_query($dbcnx,"SET character_set_client='utf8'") or exit('SET character_set_client error');
  mysqli_query($dbcnx,"SET character_set_results='utf8'") or exit('SET character_set_results error');
  mysqli_query($dbcnx,"SET collation_connection='utf8_general_ci'") or exit('SET collation_connection error');
  mysqli_query($dbcnx,"SET NAMES `utf8`") or exit('SET NAMES error');
//  if(!mysql_select_db($dbname,$dbcnx))
//  {
//    echo "<html>
//            <head>
//            <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
//            <link rel='StyleSheet' type='text/css' href='../skins/base/reader.css' />
//            <link rel='icon' href='../favicon.ico' type='image/x-icon' />
//            <link rel='shortcut icon' href='../favicon.ico' type='image/x-icon' />
//            <title>".$TEXT['global-title']."</title>
//            </head><body>
//            <table align='center' width='95%' border='0' cellspacing='0' cellpadding='0'>
//            <tr><td width='16'>&nbsp;</td><td></td><td width='16'>&nbsp;</td></tr>
//            <tr><td class='osn_top_r'></td><td class='osn_top'></td><td class='osn_top_l'></td></tr>
//            <tr><td class='osn_left'>&nbsp;</td><td class='osn_center'><table align='center' border='0'><tr align='center' ><td><img alt='stop' src='../skins/base/stop.png' /></td></tr><tr  align='center' ><td><span class='bold_it'>".$TEXT['error-conf2']."</span></td></tr></table><td class='osn_right'>&nbsp;</td></tr>
//            <tr><td class='osn_bottom_r'></td><td class='osn_bottom'></td><td class='osn_bottom_l'></td></tr>
//            </table></body></html>";
//    exit();
//  }
?>