Facebook
From Unique Goose, 3 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 146
  1. <?php
  2. require_once("forumdb.php");
  3.  
  4. if(isset($_POST['idKategorii']) && isset($_POST['tytul']) && isset($_POST['tresc']) && isset($_POST['autor'])){
  5.     if($DataBase){
  6.         $str = sprintf("INSERT INTO `posty` (`idKategorii`, `tytul`, `tresc`, `autor`) VALUES ('%d', '%s', '%s', '%s')",
  7.             htmlspecialchars($_POST['idKategorii']),
  8.             htmlspecialchars($_POST['tytul']),
  9.             htmlspecialchars($_POST['tresc']),
  10.                         htmlspecialchars($_POST['autor']));
  11.        
  12.                 $result = $DataBase->query($str);
  13.         $DataBase->close();
  14.                
  15.     }  
  16.        
  17. }
  18.  
  19. header('Location: index.php');
  20.  
  21. ?>
  22.  
  23.  
  24.  
  25.  
  26.