Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Galear estava vendo uma video aula no YOUTUBE e segui sertin mais ta dando um erro olhem por favor: e me informe: =]
Paginas
#index.php
<html>
<head>
<title>Documento</title>
</head>
<?php
include "topo.php";
include "conteudo.php";
include "rodape.php";
?>
<body>
</body>
</html>
#css.php
<html>
<head>
<title>Documento</title>
<link href="css/topo.css" rel="stylesheet" type="text/css" />
<link href="css/conteudo.css" rel="stylesheet" type="text/css" />
<link href="css/rodape.css" rel="stylesheet" type="text/css" />
</head>
<body>
</body>
</html>
#topo.php
<html>
<head>
<title>Teste PHP</title>
</head>
<?php
include "css.php";
?>
<body>
<div id="topo">
<div id="img_topo">
<h2>Imagem Topo</h2>
</div>
</div>
</body>
</html>
#conteudo.php
<html>
<head>
<title>Teste PHP</title>
</head>
<body>
</body>
<?php
switch ($_GET['pagina'])(
case 'servicos';
include "servicos.php";
break;
case 'contato';
include "contato.php";
break;
default:
include ("home.php");
break;
)
?>
</html>
#rodape.php
<html>
<head>
<title>Teste PHP</title>
</head>
<?php
include "css.php";
?>
<body>
<div id="rodape">
<h2>Rodape</h2>
</div>
</body>
</html>
#home.php
<html>
<head>
<title>Teste PHP</title>
</head>
<?php
include "css.php";
?>
<body>
</body>
<div id="geral_conteudo">
<?php include "menu.php"; ?>
<div id="box_right">
<h2>Box Direito</h2>
</div>
</div>
</html>
#menu.php
<html>
<head>
<title>Teste PHP</title>
</head>
<body>
<div id="box_left">
<ul>
<li><a href="?pagina=home"> Home </a></li>
<li><a href="?pagina=servicos"> Serviços </a></li>
<li><a href="?pagina=contato"> Contato </a></li>
<ul>
</div>
</body>
</html>
#servicos.php
<html>
<head>
<title>Teste PHP</title>
</head>
<?php
include "css.php";
?>
<body>
</body>
<div id="geral_conteudo">
<?php include "menu.php"; ?>
<div id="box_right">
<h2>Serviços</h2>
</div>
</div>
</html>
#contato.php
<html>
<head>
<title>Teste PHP</title>
</head>
<?php
include "css.php";
?>
<body>
</body>
<div id="geral_conteudo">
<?php include "menu.php"; ?>
<div id="box_right">
<h2>Contato</h2>
</div>
</div>
</html>
CSS
#conteudo.css
#geral_conteudo { margin: 0 auto; width: 800px; height: 300px; border:#FF0000 1px solid; margin-top: 10px; }
#box_left { width: 200px; height: 280px; border:#FF0000 1px solid; float: left; margin: 10px 0px 0px 10px; text-align: center; }
#box_right { width: 565px; height: 280px; border:#FF0000 1px solid; float: left; margin: 10px 0px 0px 10px; text-align: center; }
#topo.css
* { margin: 0px; padding: 0px; }
#topo { margin: 0 auto; width: 800px; height: 130px; border:#FF0000 1px solid; margin-top: 5px; }
#img_topo { width: 300px; height: 100px; border:#FF0000 1px solid; margin: 10px 0px 0px 10px; text-align: center; }
#rodape.css
#rodape { margin: 0 auto; width: 800px; height: 85px; border: #FF0000 1px solid; margin-top: 10px; margin-bottom: 5px; text-align: center; }
Qual o erro?
Bom na index onde os includes são topo / conteudo / rodape, eu troquei porque no video trocamos o conteudo do conteudo para home, ai ta, mais na hora de atualiza a pagina exemplo? index.php?pagina=contato e os outros links a pagina não atualiza, fica somente na index, podem me ajuda? vlw
Carregando comentários...