daily pastebin goal
80%
SHARE
TWEET

proses.php

a guest Mar 14th, 2018 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $Id1 = $_POST ["Id1"];
  3. $Id2 = $_POST ["Id2"];
  4. $Nomor = $_POST ["Nomor"];
  5. $Nama = $_POST ["Nama"];
  6. $Unit = $_POST ["Unit"];
  7. $Kupon = $_POST ["Kupon"];
  8. $Hadiah = $_POST ["Hadiah"];
  9.  
  10. if (empty($Id1) or empty($Id2)) die("<script type='text/javascript'>alert('Pastikan Data Terisi');history.go(-10);</script>");
  11.  
  12. include ("./pengaturan/conn.php");
  13.  
  14. $query1 = "insert into pemenang " . "(Nomor,Nama,Unit,Kupon,Hadiah) " . " values ('$Nomor','$Nama','$Unit','$Kupon','$Hadiah')";
  15. $hasil1 = mysql_query($query1);
  16.  
  17. $query2 = "delete from tbl_hadiah " . "where Id = '$Id1'";
  18. $hasil2 = mysql_query($query2);
  19.  
  20. $query3 = "delete from tbl_peserta " . "where Id = '$Id2'";
  21. $hasil3 = mysql_query($query3);
  22.  
  23. if (($hasil1 == TRUE) and ($hasil2 == TRUE) and ($hasil3 == TRUE))
  24. {
  25. echo"<script type='text/javascript'>window.location.href='index.php';</script>";
  26. }
  27. else
  28. {
  29. echo"<script type='text/javascript'>alert('Gagal');window.location.href='index.php';</script>";
  30. }
  31. mysql_close($koneksi);
  32. ?>
  33. </body>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top