Jump to content


Photo

Como Fazer Query String Desse Jeito ?


  • Faça o login para participar
2 replies to this topic

#1 R.Sanchez

R.Sanchez

    Turista

  • Usuários
  • 32 posts
  • Sexo:Não informado

Posted 24/05/2006, 10:02

ae galaera tah mto xxxxxx to fazendo um site pra um estagio e me compliquei, queria fazer um site com query string mas o site possui varios includes... e naun ta dando nada certo

index.php
<html>
<head>
<title>DENTAL PRADO - PRODUTOS ODONTOLÓGICOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<div align="left"></div>
<body topmargin="2" leftmargin="2">
<table width="93%" height="245" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
  <tr style="margin-top: 0; margin-bottom: 0">
	<td width="100%"><?php include("logo/logo.htm"); ?></td>
  </tr>
  <tr style="margin-top: 0; margin-bottom: 0"> 
	<td width="100%"><?php include("conteudo.php"); ?></td>
  </tr>
</table>
</body>
</html>

na index.php dei dois includes, logo.php e o conteudo.php

=====================================================================


conteudo.php
<html>
<head>
<title>Documento sem t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body topmargin="2" leftmargin="2">

<div align="left">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="806" height="327" id="AutoNumber1">
	<tr>
	  <td width="515" height="88" colspan="2"><?php include("noticias/noticias.php"); ?></td>
	  <td width="81" height="286" rowspan="2"><?php include("empresas/empresas.htm"); ?></td>
	</tr>
	<tr>
	  <td width="94" height="198"><?php include("menu/menu.php"); ?></td>
	  <td width="421" height="198"><?php include("equiprado/equiprado.htm"); ?></td>
	</tr>
	<tr>
	  <td width="602" height="37" colspan="3"><?php include("copyright/copyright.htm"); ?></td>
	</tr>
  </table>
</div>

</body>

</html>

agora no conteudo.php ele da includes para as partes dos site, fiz assim pensando em poder atualizar facilmente...


=====================================================================


menu.htm
<body topmargin="0" leftmargin="0">

<div align="left">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="177" height="406" id="AutoNumber1">
	<tr>
	  <td width="182" height="296" background="menu/bg_menu.jpg">
	  <div align="center">
		<center>
	  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="93%" id="AutoNumber2" height="338">
		<tr>
		  
<td width="100%" height="19"> <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
<a href="index.php?secao=teste" style="text-decoration: none"> <font color="#000000">Empresa</font></a>&nbsp;&nbsp;&nbsp; 
</font> </td>
		</tr>
		<tr>
		  <td width="100%" height="19">
		  <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
		  Cadastro</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19">
		  <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
		  Promoções</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19">
		  <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
		  Equipamentos</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19">
		  <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
		  Filiais</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19">
		  <font face="Arial Unicode MS" size="2" color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; 
		  Revista Dental Prado</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19"><font size="2" color="#666666">&nbsp;</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19"><font size="2">&nbsp;</font></td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="19">&nbsp;</td>
		</tr>
		<tr>
		  <td width="100%" height="24">&nbsp;</td>
		</tr>
	  </table>
		</center>
	  </div>
	  </td>
	</tr>
  </table>
</div>

</body>

Agora vem o desafio rsrsrs como fazer abrir uma pagina no lugar da pagina "conteudo.php" que fica la na index.php, so eh ver a index que vc ve la o include do conteudo.php...


eu naun consegui... pois sei mto pouco de php

Abraçosssss t+ :blink:

#2 Paulo André

Paulo André

    Why so serious?

  • Ex-Admins
  • 5114 posts
  • Sexo:Masculino
  • Localidade:Belo Horizonte - MG
  • Interesses:O.Q.F.J.?

Posted 24/05/2006, 10:32

No lugar de <?php include("conteudo.php"); ?> você pode fazer assim:
<?
switch($_GET['act']){
  case 'sobre': include("sobre.php"); break
  case 'localizacao': inlcude("localizacao.php"); break;
  default: include("conteudo.php");
}
?>
Ai, nos links você coloca assim:
<a href="index.php?act=sobre">Sobre</a>
E lá na estrutura switch..case, o arquivo incluído vai variar de acordo com o act da URL.

Flws...
;)Até mais
Paulo André G Rodrigues,
ex-administrador Fórum WMO.


www.CanalDev.com.br

#3 Goku Jr

Goku Jr

    Nilson

  • Usuários
  • 3757 posts
  • Sexo:Masculino

Posted 24/05/2006, 16:11

Um tutorial muito bom ^^'

Query String

T+
-----------------------------------------------------------------------
PALMEIRAS - Primeiro campeão do mundo em 1951




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq