Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- doAddC.php
- <?php
- include('includes/functions.php');
- if(isset($_POST['submit'])){
- if(isset($_POST['CatName'])){
- addCat($_POST['CatName'], $_POST['Desc']);
- header('Location: cat.php');
- }else{
- echo"Molimo unesite ime kategorije!";
- include('addCat.php');
- }
- }else{
- header("Location: addCat.php");
- }
- ?>
- cat.php
- <?php
- include('includes/functions.php');
- ?>
- <html>
- <head>
- <title>Ante's CMS</title>
- </head>
- <body>
- <?php
- session_start();
- if (isset($_SESSION['user'])) {
- ?>
- <h4><a href="index.php">Idi na glavni menu</a></h4>
- <h4><a href="addCat.php">Dodaj novu kategoriju</a></h4><br>
- <table cellspacing="0" cellpadding="10">
- <thead>
- <tr>
- <td> Ime clanka:</td>
- <td>Opis tutorijala:</td>
- <td>Action:</td>
- </tr>
- </thead>
- <tbody>
- <?php
- getcats();
- ?>
- </tbody>
- </table>
- <?php
- } else{
- header("Location: login.php");
- }
- ?>
- </body>
- </html>
- addCat.php
- <html>
- <head>
- <title>Johnny's CMS</title>
- </head>
- <body>
- <h2>Dodaj kategoriju</h2>
- <form action="doAddC.php" method="POST">
- <table>
- <tr>
- <td><label for="CatName">Name</label></td><td><input type="text" name="CatName"/></td>
- </tr>
- <td><label for="CatDesc">Opis</label></td><td><input type="text" name="Desc"/></td>
- <tr>
- <td>
- <colspan="2"><input type="submit" name="submit"/>
- </tr>
- </tr>
- </form>
- <a href="Cat.php">Vrati se!</a><br><br>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment