Commit 9b8dfb45 by Desi Enjelina Lubis

perbaikan form dan fungsi mengirimkan saran

parent 0bf36cc0
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
<span class="input__label-content input__label-content--ichiro">Nama Anda...</span> <span class="input__label-content input__label-content--ichiro">Nama Anda...</span>
</label> </label>
</span> </span>
<span class="input input--ichiro">
<input class="input__field input__field--ichiro" type="email" id="input-26" name="email" placeholder="Email Anda" required="" />
<label class="input__label input__label--ichiro" for="input-26">
<span class="input__label-content input__label-content--ichiro">Email Anda...</span>
</label>
</span>
<textarea name="komentar" placeholder="Saran Anda..." required=""></textarea> <textarea name="komentar" placeholder="Saran Anda..." required=""></textarea>
<input type="submit" name="kirim" value="kirim"> <input type="submit" name="kirim" value="kirim">
</form> </form>
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
include 'koneksi.php'; include 'koneksi.php';
$nama_pengirim = $_POST['nama_pengirim']; $nama_pengirim = $_POST['nama_pengirim'];
$email = $_POST['email'];
$komentar = $_POST['komentar']; $komentar = $_POST['komentar'];
$query = mysqli_query($koneksi, "INSERT INTO t_komentar VALUES('', '$nama_pengirim', '$komentar', NOW())"); $query = mysqli_query($koneksi, "INSERT INTO t_komentar VALUES('', '$nama_pengirim', '$email','$komentar', NOW())");
if ($query) { if ($query) {
echo "<script>alert('Terimakasih $nama_pengirim telah memberikan masukannya !'); window.location = 'contact.php'</script>"; echo "<script>alert('Terimakasih $nama_pengirim telah memberikan sarannya !'); window.location = 'index.php'</script>";
}else{ }else{
echo "<script>alert('$nama_pengirim gagal menginput masukan !'); window.location = 'contact.php'</script>"; echo "<script>alert('$nama_pengirim gagal menginput saran !'); window.location = 'contact.php'</script>";
} }
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
require_once("koneksi.php"); require_once("koneksi.php");
$id=$_GET['id']; $id=$_GET['id'];
mysqli_query($koneksi, "DELETE FROM t_komentar where id_komentar='$id'"); mysqli_query($koneksi, "DELETE FROM t_komentar where id_komentar='$id'");
echo "<script>alert('Komentar berhasil dihapus');window.location = 'processcomment.php'</script>"; echo "<script>alert('Saran berhasil dihapus');window.location = 'processcomment.php'</script>";
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment