<?php
$id = $_REQUEST['id'];
include 'config.php';
if(!isset($_SESSION['login'])) { if (!$_POST['login']) {
echo \"<head><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-2\"> <link rel=\"stylesheet\" type=\"text/css\" href=\"Obrazki/styl.css\"></head>\";
echo \"<form method=\"POST\" action=\"panel.php\"><center> <table width=223 border=0 cellpadding=0 cellspacing=0 height=\"11\">
<p align=\"center\"><h1>Panel administracyjny </h1></p>
<tr>
<TD width=47 height=20 valign=\"top\">login</TD>
<TD width=62 height=20 valign=\"top\">
<input type=\"text\" name=\"login\" size=\"20\"></TD>
</tr>
<tr>
<TD width=47 height=20 valign=\"top\">pass</TD>
<TD width=62 height=20 valign=\"top\">
<input type=\"password\" name=\"haslo\" size=\"20\"></TD>
</tr>
<tr>
<TD width=47 height=20 valign=\"top\"></TD>
<TD width=62 height=20 valign=\"top\">
<input type=\"submit\" value=\"Zaloguj\" size=\"20\"></TD>
</tr>
</table></center>\";
}
else
{
$sql = \"SELECT * FROM uzytkownicy WHERE login = '\".$_POST['login'].\"'\";
if (!$_POST['haslo'] == $login['haslo']) {
echo 'Podales zle dane lub sesja jest juz nieaktywna.<br><a href=\"panel.php\">Spróbuj jeszcze raz</a>'; }
else
{
$_SESSION['login'] = $login['login'];
echo 'Zostales pomyslnie zalogowany zapraszamy do panelu<br><a href=\"'.$_SERVER['PHP_SELF'].'\">Wejdz</a>'; }
}
}
else
{
echo \"<head><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-2\"> <link rel=\"stylesheet\" type=\"text/css\" href=\"Obrazki/styl.css\"></head>
<center>
<table width=400 border=0 cellpadding=0 cellspacing=0 height=\"100\">
<tr>
<TD width=114 height=23 valign=\"top\" align=\"center\"><b>Kategorie</b><br>
</TD>
<TD width=157 height=23 valign=\"top\" align=\"center\"><b>Opisy</b></TD>
<TD width=129 height=23 valign=\"top\">
<p align=\"center\"><b>Zgłoszone</b></TD>
</tr>
<tr>
<TD width=114 height=77 valign=\"top\">
<p align=\"center\"><a href=\"panel.php?id=addcat\">- Dodaj</a><br>
<a href=\"panel.php?id=delcat\">- Skasuj</a></TD>
<TD width=157 height=77 valign=\"top\">
<p align=\"center\"><a href=\"panel.php?id=addop\">- Dodaj</a><br>
<a href=\"panel.php?id=delop\">- Skasuj</a></TD>
<TD width=129 height=77 valign=\"top\">
<p align=\"center\"><a href=\"panel.php?id=kolejka\">- Wyswietl</a></TD>
</tr>
</table></center>\";
if ($id == \"addcat\")
{
echo \"<center><form action=\"panel.php?id=zapisz\" method=\"post\"> <table border=\"0\">
<tr bgcolor=\"#cccccc\">
</tr>
<tr>
<td>Wpisz nazwę kategorii</td>
<td align=\"center\"><input type=\"text\" name=\"kategoria\" sizi=\"3\" maxlenght=\"3\"></td>
</tr>
<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Dodaj\"></td>
</tr>
</table>
</center>
</form>\";
}
elseif ($id == \"zapisz\")
{
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-2\">
</head>\";
$kategoria = $_POST['kategoria'];
if (!$kategoria)
{
echo \"podaj kategorie\"; }
include(\"config.php\");
$query = \"INSERT INTO `kategorie` ( `id` , `kategoria` ) VALUES ('', '\".$_POST['kategoria'].\"')\";
if($result > 0) {
echo(\"<center>dziękujemy dane zostaly zapisane :)</center>\"); }
elseif ($id == \"addop\")
{
echo \"<center><form action=\"panel.php?id=zapiszopis\" method=\"post\"> <table border=\"0\">
<tr bgcolor=\"#cccccc\">
</tr>
<tr>
<td>Wpisz nazwę kategorii</td>
<td align=\"center\"><input type=\"text\" name=\"kategoria\" sizi=\"3\" maxlenght=\"3\"></td>
</tr>
<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Dodaj\"></td>
</tr>
</table>
</center>
</form>\";
}
}
}
?>
to plik panel.php wszystko w nim działa ok tylko mam problem taki to if-y
jest zrobione tak:
<?php
if ($id == \"addcat\")
{
}
elseif ($id == \"zapisz\")
{
}
elseif ($id == \"addop\")
{
}
?>
Chodzi o to że wywołanie panel.php?id=addcat działa panel.php?id=zapisz działa a wszystki co znajduje się już w kolejnych if-ach lub elseif-ach nie działa co bym tam wstawił nie chce się wywołać