//echo 'Ваш ip '.$_SERVER['REMOTE_ADDR'];
$hostname = "localhost"; // название/путь сервера, с MySQL
$username = "root"; // имя пользователя (в Denwer`е по умолчанию "root")
$password = "";
$dbName = "oodb";
/* Создаем соединение */
mysql_connect($hostname, $username, $password) or die ("Не могу создать соединение");
/* Выбираем базу данных. Если произойдет ошибка - вывести ее */
mysql_select_db($dbName) or die (mysql_error());
mysql_query('SET NAMES utf8');
mysql_query('SET CHARACTER SET utf8' );
mysql_query('SET COLLATION_CONNECTION="utf8_general_ci"' );
?>
$i=0;
$a=$_SERVER['REQUEST_URI'];
if ($_GET['selectOpt']==Null and $_GET['gender']==Null)
{
$res = mysql_query("SELECT title, introtext, id, nazv_file, age, catid, images, state FROM euw3m_content where catid = '150' and state='1' ORDER BY title asc");
}
else
{
$res = mysql_query("SELECT title, introtext, id, nazv_file, age, catid, images, state FROM euw3m_content where catid = '".$_GET['selectOpt']." ' and state='1' and age >= '".$_GET['gender']."' ORDER BY title asc");
}
while ($row = mysql_fetch_row($res))
{
$i=$i+1;
$res1 = mysql_query("SELECT title,id FROM euw3m_categories where id = '".$row[5]."'");
$row1 = mysql_fetch_row($res1);
$filename = "".$row[3].".txt";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo("