plik:dodaj_news.php
<?php if($_POST['tytul'] && $_POST['tresc']){ $tytul = $_POST['tytul']; $tresc = $_POST['tresc']; } else{ } ?> <form action="panel_admina.php?id=dodaj_news" method="post"> Tytuł: <textarea name="tytul" rows="1"></textarea><br /> Treść: <textarea name="tresc"></textarea><br /> <br /> <input type="submit" value="Dodaj"/> </form>
plik panel_admina.php
<?php include_once "sesje.php"; include_once "sprawdz.php"; ?> <?php require_once "baza.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="Description" content="Tu wpisz opis zawartości strony" /> <meta name="Keywords" content="Tu wpisz wyrazy kluczowe rozdzielone przecinkami" /> <title>Panel Admina - Fani Assasin's Creed</title> </head> <body> <div> <div id="menuu" style="float: left; width: 200px;"> <a href="panel_admina.php">Panel Admina</a><br /> <a href="panel_admina.php?id=dodaj_news">Dodaj newsa</a><br /> <a href="panel_admina.php?id=edytuj_news">Edytuj newsa</a><br /> <a href="panel_admina.php?id=usun_news">Usuń newsa</a><br /> </div> <div id="tresc" style="float: left; width: 800px;"> <?php switch($id) { case 'dodaj_news': require_once ("dodaj_news.php"); break; case 'edytuj_news': require_once ("edytuj_news.php"); break; case 'usun_news': require_once ("usun_news.php"); break; case ('4'): require_once ("filmy.php"); break; case ('5'): require_once ("materialy.php"); break; case ('6'): require_once ("recenzja.php"); break; case ('7'): require_once ("ciekawostki.php"); }; ?> </div> </div> </body>