AVISANDO, O CÓDIGO DAS PÁGINAS SÃO GRANDES, MAIS O QUE QUERO MESMO, ESTÁ NO FINAL DESTE POST. Bom pessoal, abaixo vou seguir o codigo de duas páginas. Irei explicando no decorrer do post. A primeira página chama-se: colecoes.php Nessa página, ela faz um GET no banco de dados, no menu do site mostra os dados de uma tabela do banco de dados, no caso mostra os itens cadastrados que são os itens do menu, certo? Quando clica em algum desses links, vai para a página colecoes.php dando um GET nos dados da tabela, com os dados do GET. Abaixo segue a página coleções: <? include('config.php'); ?>
<?
$color1 = "greyBox";
$color2 = "whiteBox";
$row_count = 0;
?><html>
<head>
<title>Kawavess.com.br</title>
<link href="estilo.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<link href="menui6.css" rel="stylesheet" type="text/css" />
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#popitmenu{
position: absolute;
background-color: #151618;
border:1px solid #151618;
font: normal 12px Verdana;
line-height: 18px;
z-index: 100;
visibility: hidden;
}
#popitmenu a{
text-decoration: none;
padding-left: 6px;
color: #FFFFFF;
display: block;
}
#popitmenu a:hover{ /*hover background color*/
background-color: #80A9BD;
}
</style>
<?
$fonte = "<font face=\"Verdana, Arial\" size=\"2\" color=\"#FFFFFF\">";
$fonte1 = "</font>";
?>
<script type="text/javascript">
/***********************************************
* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var defaultMenuWidth="500px" //set default menu width.
var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
<?
$note = mysql_query("SELECT * FROM `noticias` ORDER BY id DESC LIMIT 5");
while($not = mysql_fetch_array($note)) {
$teste = "linkset[1]+='$fonte<a href=\"noticias.php?id=$not[id]\">[$not[data]] $not[titulo]</a>$fonte1'"; ?>
<? echo $teste; ?> <? } ?>
////No need to edit beyond here
var ie5=document.all && !window.opera
var ns6=document.getElementById
if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//FiA?}?u?n?d out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}
function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}
function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}
function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}
if (ie5||ns6)
document.onclick=hidemenu
</script>
</head>
<body bgcolor="#000000" background="imagens/bg.jpg">
<div align="center">
<?
$qr = mysql_query("SELECT * FROM galeria ORDER BY sexo ASC") or die(mysql_error());
$query = mysql_query("SELECT * FROM categoria WHERE id='$_GET[id]'") or die(mysql_error());
$umb = mysql_fetch_array($query); {
?>
<div id="lay">
<table width="855" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="imagens/spacer.gif" width="15" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="101" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="637" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="87" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="15" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="2"><img name="site1_r1_c1" src="imagens/site1_r1_c1.jpg" width="116" height="84" border="0" alt=""></td>
<td><img name="site1_r1_c3" src="imagens/site1_r1_c3.jpg" width="637" height="50" border="0" alt=""></td>
<td colspan="2" rowspan="2" align="center" background="imagens/site1_r1_c4.jpg"><a href="#" onMouseover="showmenu(event,linkset[1], '400px')" onMouseout="delayhidemenu()"><img src="imagens/site_icone_informante.png" width="77" height="81"></a></td>
<td><img src="imagens/spacer.gif" width="1" height="50" border="0" alt=""></td>
</tr>
<tr>
<td bgcolor="151618"> <ul id="menu">
<li><a href="http://www.kawavess.com.br/">Home</a></li>
<li><a href="site.php?pag=kawavess">Kawavess</a></li>
<li><a href="#">Coleções</a>
<ul>
<?
$getrares = mysql_query("SELECT * FROM `categoria` ORDER BY id DESC");
while($um = mysql_fetch_array($getrares)) {
$row_color = ($row_count % 2) ? $color1 : $color2;
?>
<li><a href="colecoes.php?id=<?=$um[id];?>">
<?=$um[nome];?>
<?=$um[ano];?>
</a></li>
<?php
$row_count++;
}?>
</ul>
</li>
<li><a href="site.php?pag=lojas">Lojas</a></li>
<li><a href="parceiros.php">Parceiros</a></li>
<li><a href="contato.php">Contato</a></li>
</ul></td>
<td><img src="imagens/spacer.gif" width="1" height="34" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r3_c1" src="imagens/site1_r3_c1.jpg" width="855" height="13" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="13" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="site1_r4_c1" src="imagens/site1_r4_c1.jpg" width="15" height="528" border="0" alt=""></td>
<td colspan="3" valign="top" background="imagens/site1_r4_c2.jpg"> <div align="center">
<table width="778" height="33" align="center">
<tr>
<td colspan="2"> <div align="center"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
<?=$umb[nome];?> <?=$umb[ano];?>
</font> </div></td>
</tr>
<tr>
<td width="379"><a href="galeria.php?nome=<?=$umb[nome];?>&sexo=<?=$umb[feminino];?>">Feminino</a></td>
<td width="383"><a href="galeria.php?nome=<?=$umb[nome];?>&sexo=<?=$umb[masculino];?>">Masculino</a></td>
</tr>
</table></div></td>
<td rowspan="2"><img name="site1_r4_c5" src="imagens/site1_r4_c5.jpg" width="15" height="528" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="515" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="site1_r5_c2" src="imagens/site1_r5_c2.jpg" width="825" height="13" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="13" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r6_c1" src="imagens/site1.jpg" width="855" height="48" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="48" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r7_c1" src="imagens/site1_r7_c1.jpg" width="855" height="3" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
</table></div>
</div>
<? } ?>
</body>
</html>
A segunda página chama-se: galeria.php
Nessa página, ela precisa fazer o GET em duas tabelas, através dos resultados obtidos na página colecoes.php.
Abaixo segue o código da página:
<? include('config.php'); ?>
<?
$color1 = "greyBox";
$color2 = "whiteBox";
$row_count = 0;
?><html>
<head>
<title>Kawavess.com.br</title>
<link href="estilo.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<link href="menui6.css" rel="stylesheet" type="text/css" />
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#popitmenu{
position: absolute;
background-color: #151618;
border:1px solid #151618;
font: normal 12px Verdana;
line-height: 18px;
z-index: 100;
visibility: hidden;
}
#popitmenu a{
text-decoration: none;
padding-left: 6px;
color: #FFFFFF;
display: block;
}
#popitmenu a:hover{ /*hover background color*/
background-color: #80A9BD;
}
</style>
<?
$fonte = "<font face=\"Verdana, Arial\" size=\"2\" color=\"#FFFFFF\">";
$fonte1 = "</font>";
?>
<script type="text/javascript">
/***********************************************
* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var defaultMenuWidth="500px" //set default menu width.
var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
<?
$note = mysql_query("SELECT * FROM `noticias` ORDER BY id DESC LIMIT 5");
while($not = mysql_fetch_array($note)) {
$teste = "linkset[1]+='$fonte<a href=\"noticias.php?id=$not[id]\">[$not[data]] $not[titulo]</a>$fonte1'"; ?>
<? echo $teste; ?> <? } ?>
////No need to edit beyond here
var ie5=document.all && !window.opera
var ns6=document.getElementById
if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Fin?d out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}
function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}
function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}
function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}
if (ie5||ns6)
document.onclick=hidemenu
</script>
</head>
<body bgcolor="#000000" background="imagens/bg.jpg"><div align="center">
<div id="lay">
<table width="855" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="imagens/spacer.gif" width="15" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="101" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="637" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="87" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="15" height="1" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="2"><img name="site1_r1_c1" src="imagens/site1_r1_c1.jpg" width="116" height="84" border="0" alt=""></td>
<td><img name="site1_r1_c3" src="imagens/site1_r1_c3.jpg" width="637" height="50" border="0" alt=""></td>
<td colspan="2" rowspan="2" align="center" background="imagens/site1_r1_c4.jpg"><a href="#" onMouseover="showmenu(event,linkset[1], '400px')" onMouseout="delayhidemenu()"><img src="imagens/site_icone_informante.png" width="77" height="81"></a></td>
<td><img src="imagens/spacer.gif" width="1" height="50" border="0" alt=""></td>
</tr>
<tr>
<td bgcolor="151618"> <ul id="menu">
<li><a href="http://www.kawavess.com.br/">Home</a></li>
<li><a href="site.php?pag=kawavess">Kawavess</a></li>
<li><a href="#">Coleções</a>
<ul>
<?
$getrares = mysql_query("SELECT * FROM `categoria` ORDER BY id DESC");
while($um = mysql_fetch_array($getrares)) {
$row_color = ($row_count % 2) ? $color1 : $color2;
?>
<li><a href="colecoes.php?id=<?=$um[id];?>">
<?=$um[nome];?>
<?=$um[ano];?>
</a></li>
<?php
$row_count++;
}?>
</ul>
</li>
<li><a href="site.php?pag=lojas">Lojas</a></li>
<li><a href="parceiros.php">Parceiros</a></li>
<li><a href="contato.php">Contato</a></li>
</ul></td>
<td><img src="imagens/spacer.gif" width="1" height="34" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r3_c1" src="imagens/site1_r3_c1.jpg" width="855" height="13" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="13" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="site1_r4_c1" src="imagens/site1_r4_c1.jpg" width="15" height="528" border="0" alt=""></td>
<td colspan="3" valign="top" background="imagens/site1_r4_c2.jpg"> <div align="center">
<table width="778" height="33" align="center">
<tr>
<td colspan="2"> <div align="center"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
<? $nome = $_GET['nome']; ?>
<? $sexo = $_GET['sexo']; ?>
</font> </div></td>
</tr>
<tr>
<td>
<?
$bus = mysql_query("SELECT * FROM `galeria` WHERE sexo = '$_GET[sexo]'");
while($dados = mysql_fetch_array($bus)) {
echo "colecoes/$nome/$sexo/$dados[caminho]<br>";
echo "<img src='colecoes/$nome/$sexo/$dados[caminho]' width='100' height='100'>";
}
?>
</td>
</tr>
</table></div></td>
<td rowspan="2"><img name="site1_r4_c5" src="imagens/site1_r4_c5.jpg" width="15" height="528" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="515" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="site1_r5_c2" src="imagens/site1_r5_c2.jpg" width="825" height="13" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="13" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r6_c1" src="imagens/site1.jpg" width="855" height="48" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="48" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="site1_r7_c1" src="imagens/site1_r7_c1.jpg" width="855" height="3" border="0" alt=""></td>
<td><img src="imagens/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
</table></div>
</div>
</body>
</html> Resumindo: O sistema é de uma galeria de fotos, onde tem, suponhamos assim a categoria = coleções e conteudo = galeria, quando eu clico no link do menu, vai para a categoria aparecendo o nome e a descrição = sexo (campo da tb), vai aparecer dois links na página coleçoes, os dois sexos, feminino e masculino. Quando clica no link vai para a página galeria, aparecendo as imagens de cada sexo, cliquei em masculino vai aparecer só as imagens cadastradas no BD do masculino e o feminino a mesma coisa. Eu consegui fazer isso, mais quando clico no sexo e vai para a galeria, aparece todos os cadastros de tal categoria, não do sexo. Ai cliquei em masculino, vai aparecer todos os cadastros, porém será visualizado somente a imagem do masculino e vice-verso. Como faço para aparecer somente os cadastros de acordo com GET, acho que o erro é do GET, alguém me ajuda? É URGENTE, PRECISO MUITO DA AJUDA DE VOCÊS!