Plik hintf.php:
<?php function hintwykaz (){ ?> <br><br> <?php }} function addform(){ ?> <center>Dodaj porade</center><br> <form method="post" action="hint.php?site=add"> Porada: <input type="text" name="porada"> <input type="submit" name="Submit" value="Wyślij"> </form> <?php } function editform($id){ ?> <center>Edytuj porade</center><br> <input type="submit" name="Submit" value="Wyślij"> </form> <?php }} function addhint($porada){ } function edithint($porada){ }
Plik hint.php
<?php include ("body.php"); include ("hintf.php"); connect(); head(); if ($_GET["site"] == addform){ if ($_SESSION["prawa"] == 2){ addform();}} elseif ($_GET["site"] == add){ if ($_SESSION["prawa"] == 2){ addhint($_POST["porada"]);}} elseif ($_GET["site"] == editform){ if ($_SESSION["prawa"] == 2){ editform($_GET["id"]);}} elseif ($_GET["site"] == edit){ if ($_SESSION["prawa"] == 2){ edithint($_GET["porada"]);}} elseif ($_GET["site"] == wykaz){ if ($_SESSION["prawa"] == 2){ hintwykaz();}} else { foot(); ?>