Skip to content

Instantly share code, notes, and snippets.

@wichaksono
Created January 27, 2018 05:32
Show Gist options
  • Save wichaksono/054b1087bb8cc4004bb7f8cced542e98 to your computer and use it in GitHub Desktop.
Save wichaksono/054b1087bb8cc4004bb7f8cced542e98 to your computer and use it in GitHub Desktop.
<?php
require_once 'config.php';
if (isset($_GET['nomer']) && ! empty($_GET['nomer'])) {
$nomerVote = $_GET['nomer'];
// sql untuk menambahkan vote kedatabase
$sql = "INSERT INTO voting (id_opsi, date_create) VALUES ('$nomerVote', NOW()) ";
$insert = $connect->query($sql);
if ($insert) {
echo "<script>alert('Terima Kasih atas Vote nya'); window.location.href='index.php';</script>";
exit();
} else {
die('Oops!! Internal Error');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment