Index.php
//html
<?PHP
$id = $_GET["id"];
if ($id=="")
{
include("news.php");
}
else {
{
include("$id.php");
}
else
{
include("error.php");
}
}
?>
//html
Panel.php
<?PHP
if($_GET["zmiana"]=="haslo"){echo "zmiana hasla"; } if($_SESSION["zalogowany"]==1){
echo '<table border="0"><tr><td> <u>Zmiana hasla</u></td></tr><tr><td>
<form action="?zmiana=haslo" method="post">
Nowe haslo :</td><td><input type="text" size="30" name="haslo"> </td><td><input type="submit" value="Zmien" class="button"></form></td></tr>
<tr><td><u>Zmiana e-maila</u></td></tr><tr><td>
<form action="index.php?zmiana=mail" method="post">
Nowy adresu e-mail:</td><td><input type="text" size="30" name="mail"> </td><td><input type="submit" value="Zmien" class="button"></td></tr>
</table></form><br>
';}
else {echo "Musisz byc zalogowany!";} ?>
News.php
<?php
if($_GET["wyloguj"]=="tak"){$_SESSION["zalogowany"]=0;echo "Zostałeś wylogowany z serwisu";}
if($_SESSION["zalogowany"]!=1){
if(!empty($_POST["login"]) && !empty($_POST["haslo"])){ echo 'Zalogowano poprawnie jako '.$_SESSION['login'].'. <a href=index.php>Przejdz na strone główna</a>';
$_SESSION["zalogowany"]=1;
$_SESSION['login'] = $_POST['login'];
}
else echo ShowLogin
("Podano złe dane!!!"); }
else ShowLogin();
}
else{
$nick = $_POST["login"];
echo "<a href=?wyloguj=tak>Wyloguj</a>"; include("glowna.php"); ?>
<?php
}
?>
Tak to wyglada. W news.php mi includuje glowna.php ale tam jedynie tekst typu "witaj".