<?php
ob_start();
/*	if(strstr($_SERVER['HTTP_ACCEPT'], "application/xhtml+xml")) {
		header("Content-Type: application/xhtml+xml; charset: utf-8");
	}
	else { */
		header("Content-Type: text/html");
		header("Charset: utf-8");
//	}
?>
	<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

		 
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">

	<head>
	<?php
	$tytul = stripslashes($_GET[t]);
	echo"<title>Teatr w Eldoracie - $tytul</title>"; ?>
	<link href="style.css" rel="stylesheet" type="text/css" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	</head>

<body>
<?php
include ("dbconfig.php");

mysql_connect($dbconfig['address'], $dbconfig['user'], $dbconfig['password']);
mysql_select_db($dbconfig['db']);

if ($_GET['t']) {
$title = mysql_real_escape_string($_GET['t']);

$query = "SELECT * FROM `teatr_repertuar` WHERE `title` = '$title'";
$result = mysql_query("$query");

 if (mysql_num_rows($result) == '0') {
 echo "<p>Nie znaleziono sztuki. Przepraszamy.</p>";
 }
 
 else {
 $data = mysql_fetch_assoc($result);
 $title = stripslashes($data[title]);
 echo "<center><h2>$title</h2>\n";
 echo "<strong>Autor: $data[author]</strong><hr /></center>\n";
 echo "$data[content]\n\n";
 echo "<a href=\"index.php\" title=\"Powrót\">Powrót...</a>";
 }

}

else {
echo "<p>Błąd!</p>";
}
?>
</body>

</html>