<?
mysql_connect ("*****", "******", "*****") or
die ("<center><br><b>Nie mżna utworzyć połączenia z MySQL</b></center>"); mysql_select_db ("****") or
die ("<center><br><b>Nie można otworzyć bazy danych</b></center>");
$query1 = mysql_query("SELECT * FROM gallery_cat WHERE 1");
print "<ul type=\"square\">"; print "<li><a href=\"index2.php?id=3&g=$r[id]\"><b>$r[nazwa]</b></a>"; }
} else {
$query1 = mysql_query("SELECT * FROM gallery_cat WHERE id='".$_GET[g
]."'"); $query2 = mysql_query("SELECT * FROM gallery_img WHERE category='".$_GET[g
]."'"); print "<center><b>$data1[nazwa]</b><br><br><br>"; if ($size[0
]> $size[1
]){print "<a href=\"javascript: ;\" onClick=\"window.open('http://rhqq.gabo.pl/forum/open.php?g=$_GET[g]&p=$data2[id]', '', 'width=660,height=500,status=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes location=no,left=50');\"><img src=\"$data2[location]\" width=\"400\" height=\"300\" border=\"0\"></a></center>";}
if ($size[0
]< $size[1
]){print "<a href=\"javascript: ;\" onClick=\"window.open('http://rhqq.gabo.pl/forum/open.php?g=$_GET[g]&p=$data2[id]', '', 'width=500,height=660,status=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes location=no,left=50');\"><img src=\"$data2[location]\" width=\"300\" height=\"400\" border=\"0\"></a></center>";}
$query3 = mysql_query("SELECT * FROM gallery_img WHERE id > '".$data2[id
]."'"); print "<p align=\"right\"><a href=\"index2.php?id=3&g=$_GET[g]&p=$data3[id]\">--następne--</a></p><br>";
} else {
$query3 = mysql_query("SELECT * FROM gallery_img WHERE id = '".$_GET[p
]."'");
if ($size[0
]> $size[1
]){print "<a href=\"javascript: ;\" onClick=\"window.open('http://rhqq.gabo.pl/forum/open.php?g=$_GET[g]&p=$data3[id]', '', 'width=660,height=500,status=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes location=no,left=50');\"><img src=\"$data3[location]\" width=\"400\" height=\"300\" border=\"0\"></a></center>";}
if ($size[0
]< $size[1
]){print "<a href=\"javascript: ;\" onClick=\"window.open('http://rhqq.gabo.pl/forum/open.php?g=$_GET[g]&p=$data3[id]', '', 'width=500,height=660,status=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes location=no,left=50');\"><img src=\"$data3[location]\" width=\"300\" height=\"400\" border=\"0\"></a></center>";}
$query4 = mysql_query("SELECT * FROM gallery_img WHERE id > '".$data3[id
]."'"); $query5 = mysql_query("SELECT * FROM gallery_img WHERE id < '".$data3[id
]."'"); print "<table border=\"0\" align=\"center\" width=\"100%\">"; print "<tr><td align=\"left\">"; if (mysql_num_rows($query5) > 0
){print "<div align=\"left\"><a href=\"index2.php?id=3&g=$_GET[g]&p=$prev\">--poprzednie--</a></div><br>";} print "<td align=\"right\">"; if (mysql_num_rows($query4) > 0
){print "<div align=\"right\"><a href=\"index2.php?id=3&g=$_GET[g]&p=$data4[id]\">--następne--</a></div><br>";} }
}
?>
przerób na własne potrzeby