document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. class osc extends SQLite3 {
  3.     function __construct() {
  4.         $this->open("./sql/oscop.db");
  5.     }
  6. }
  7. $db = new osc();
  8. if (isset($_POST[\'submit\'])) {
  9.     $id = rand();
  10.     $title = $_POST[\'title\'];
  11.     $content = $_POST[\'content\'];
  12.     $sql = "INSERT INTO art(id, title, content) VALUES(\'".$id."\', \'".$title."\', \'".$content."\') ";
  13.     if (empty($title)) {
  14.         echo "<script>alert(\'maaf tidak boleh kosong\'); </script>";
  15.         header("Location: ./create.php");
  16.     } else {
  17.         $query = $db->exec($sql);
  18.       }
  19.     if (!empty($query)) {
  20.         header(\'Location: ./index.php\');
  21.         echo "<script>console.log(\'success\'); </script>";
  22.     } else {
  23.         echo $db->lastErrorMsg();
  24.         echo "<script>console.log(\'error\'); </script>";
  25.     }
  26. }
  27. ?>
');