diff --git a/connect.php b/connect.php new file mode 100644 index 0000000..546f9d9 --- /dev/null +++ b/connect.php @@ -0,0 +1,10 @@ + + diff --git a/edit_post.php b/edit_post.php new file mode 100644 index 0000000..3b1b71a --- /dev/null +++ b/edit_post.php @@ -0,0 +1,33 @@ +".$sql."
".mysql_error()); + +while ($row = mysql_fetch_array($result)) { + $xjudul = stripslashes($row['judul']); + $xtanggal = $row['tanggal']; + $xkonten = stripcslashes($row['konten']); + + $xjudul = str_replace('"', '\'', $xjudul); + $xkonten = str_replace('
', '', $xkonten); +} +?> + +
+ '> + +


+ '>

+ +


+

+ +
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..bc6fac1 --- /dev/null +++ b/index.php @@ -0,0 +1,136 @@ +//prepare("SELECT Pid, judul, tanggal, konten FROM post"); + //$query->execute(); + //$query->bind_result($Pid,$judul,$tanggal,$konten) +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simple Blog + + + + + +
+ + + +
+
+ +
+
+ + + +
+ + + + + + + + \ No newline at end of file diff --git a/new_post.php b/new_post.php new file mode 100644 index 0000000..039f1c7 --- /dev/null +++ b/new_post.php @@ -0,0 +1,215 @@ +255) { + $errors = "Judul terlalu panjang."; + } + + if (empty($errors)) { + include 'connect.php'; + + + $judul = mysql_real_escape_string($judul); + $tanggal = mysql_real_escape_string($tanggal); + $konten = mysql_real_escape_string($konten); + $Pid = mysql_insert_id(); + + mysql_query("INSERT INTO post SET + 'Pid' = {$Pid}, + 'judul' = '{$judul}', + 'konten' = '{$konten}', + 'tanggal' = NOW() + "); + + + header('Location: index.php?id={$Pid}'); + die(); + } +} + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simple Blog | Tambah Post + + + + + +
+ + + +
+ + +

-

+ +
+
+

Tambah Post

+ + +
+
+
+ + '> +
+
+ + '> +
+
+
+ +
+ +
+ + ".$sql."
".mysql_error()); + + if ($result!=false) { + print "Post berhasil ditambahkan."; + } + + mysql_close(); + } + + if(isset($error)) + { + foreach($error as $error) + { + echo '

'.$error.'

'; + } + } + + ?> + +
+
+
+ +
+ + + +
+ + + + + + + + \ No newline at end of file diff --git a/post.php b/post.php new file mode 100644 index 0000000..7be4316 --- /dev/null +++ b/post.php @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simple Blog | Apa itu Simple Blog? + + + + + +
+ + + +
+ +
+
+ +

Apa itu Simple Blog?

+

+
+
+ +
+
+ prepare('select Pid, judul, konten, tanggal from post where Pid=:Pid'); + $stmt->execute(array(':Pid'=>$_GET['id'])); + $row = $stmt->fetch(); + + if($row['Pid'] == '') + { + header('Location: ./'); + exit; + } + + //display selected post + echo '
'; + echo '

'.$row['judul'].'

'; + echo '

'.date('jS M Y', strtotime($row['tanggal'])).'

'; + echo '

'.$row['konten'].'

' + echo '
'; + ?> + +//
+//

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis aliquam minus consequuntur amet nulla eius, neque beatae, nostrum possimus, officiis eaque consectetur. Sequi sunt maiores dolore, illum quidem eos explicabo! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam consequuntur consequatur molestiae saepe sed, incidunt sunt inventore minima voluptatum adipisci hic, est ipsa iste. Nobis, aperiam provident quae. Reprehenderit, iste.

+//

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores animi tenetur nam delectus eveniet iste non culpa laborum provident minima numquam excepturi rem commodi, officia accusamus eos voluptates obcaecati. Possimus?

+// +//
+ +

Komentar

+ +
+
+ + + + + + +
+ + + +
+
+ +
    +
  • +
    +

    Jems

    +
    2 menit lalu
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    +
  • + +
  • +
    +

    Kave

    +
    1 jam lalu
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    +
  • +
+
+
+ +
+ + + +
+ + + + + + + + \ No newline at end of file