problema switch - site dinamic
Scris: Lun Feb 07, 2011
index.php
content.php
de la fiecare pagina imi da doar cazul "d"adika register.php?:(?
Cod: Selectaţi tot
<?php
include 'style.php';
echo
'<div style="position:absolute;top:5px;left:37%"><img src="head1.jpg"></div>
<div style="position:absolute;top:324px;left:37%;z-index: 3"><img src="head2.jpg" style="opacity:1;filter:alpha(opacity=100)" onmouseover="this.style.opacity=0.6;this.filters.alpha.opacity=50 " onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100" ></div>
<div style="position:absolute;top:460px;left:37%;z-index: 3"><img src="head3.jpg"></div>';
echo ' <!--Meniu-->';
echo '<div style="position:absolute;top:330px;left:39%;z-index: 3"><font size=4><b><a href="index.php?pagina=a">Home</a></b></font></div>
<div style="position:absolute;top:353px;left:39%;z-index: 3"><font size=4><b><a href="index.php?pagina=b">Regulament</a></b></font></div>
<div style="position:absolute;top:376px;left:39%;z-index: 3"><font size=4><b><a href="index.php?pagina=c">Login</a></b></font></div>
<div style="position:absolute;top:399px;left:39%;z-index: 3"><font size=4><b><a href="index.php?pagina=d">Register</a></b></font></div>
';
if (isset($_GET['pagina'])&&$_GET['pagina']!=""){
$pagina=$_GET['pagina'];
include 'content.php';
}
?>
Cod: Selectaţi tot
<?php
switch($pagina){
case 'a': include 'index.php';
case 'b': include 'regulament.php';
case 'c': include 'login.php';
case 'd': include 'register.php';
}
?>