diff --git a/robocze/ask.php b/robocze/ask.php
index 88bfeb7..100eb4e 100644
--- a/robocze/ask.php
+++ b/robocze/ask.php
@@ -1,14 +1,16 @@
-';
-?>
-
-
-
-if (!$result = $DB->query('SELECT * FROM photos WHERE id=\'$i\''))
+';
+?>
+
+
+
+
+$sql = "SELECT * FROM `photos` WHERE `id`='$id'";
+if (!$result = $DB->query($sql))
{
showError('MySQL error');
}
@@ -28,24 +30,24 @@ else
$row['author'] = ($row['author']=='') ? 'Autor nieznany' : $row['author'];
$row['description'] = ($row['description']=='') ? 'Brak opisu' : $row['description'];
-}
-?>
-
- =nl2br(htmlspecialchars($row['description']))?>
- =htmlspecialchars($row['author'])?>
-
-
- $prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
- $prev=$prev[0];
- if($prev>0) {
- $prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
- echo ''; #and send it
- }
- $next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
- $next=$next[0];
- if($next>0) {
- $next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
- echo ''; #and send it
- }
-?>
-
+}
+?>
+
+ =nl2br(htmlspecialchars($row['description']))?>
+ =htmlspecialchars($row['author'])?>
+
+
+ $prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
+ $prev=$prev[0];
+ if($prev>0) {
+ $prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
+ echo ''; #and send it
+ }
+ $next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
+ $next=$next[0];
+ if($next>0) {
+ $next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
+ echo ''; #and send it
+ }
+?>
+
diff --git a/robocze/config.php b/robocze/config.php
index 73f5325..21cdd8d 100644
--- a/robocze/config.php
+++ b/robocze/config.php
@@ -1,7 +1,7 @@
-
+
diff --git a/robocze/display.php b/robocze/display.php
index d2d8d77..28427ab 100644
--- a/robocze/display.php
+++ b/robocze/display.php
@@ -1,33 +1,35 @@
- 0 ||
- strpos($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")!==false ||
- strpos($_SERVER["HTTP_USER_AGENT"], "WebKit")!==false;
- header('Content-Type: '.($xhtml?'application/xhtml+x':'text/ht').'ml; charset="utf-8"'); #IE doesn't support application/xhtml+xml - workaround
- echo '';
-?>
-
-
-
-
- Podgląd zdjęcia nr =$id?>
-
-
-
-
-
-
+
+
+
+
+
+ Podgląd zdjęcia nr =$id?>
+
+
+
+
+
+
-if (!$result = $DB->query('SELECT * FROM photos WHERE id=\'$i\''))
+$sql = "SELECT * FROM `photos` WHERE id='$id'";
+if (!$result = $DB->query($sql))
{
- showError('MySQL error');
+ showError('Nie mozna pobrac informacji o zdjeciu!');
}
if ($result->num_rows == 0)
@@ -45,61 +47,62 @@ else
$row['author'] = ($row['author']=='') ? 'Autor nieznany' : $row['author'];
$row['description'] = ($row['description']=='') ? 'Brak opisu' : $row['description'];
-}?>
-
-
-$prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
-$prev=$prev[0];
-if($prev>0) {
-$prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
-?>
-
-
-}
-$next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
-$next=$next[0];
-if($next>0) {
-$next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
-?>
-
+
+$prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
+$prev=$prev[0];
+if($prev>0) {
+$prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
+?>
+
+
+}
+$next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
+$next=$next[0];
+if($next>0) {
+$next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
+?>
+