Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $Id1 = $_POST ["Id1"];
- $Id2 = $_POST ["Id2"];
- $Nomor = $_POST ["Nomor"];
- $Nama = $_POST ["Nama"];
- $Unit = $_POST ["Unit"];
- $Kupon = $_POST ["Kupon"];
- $Hadiah = $_POST ["Hadiah"];
- if (empty($Id1) or empty($Id2)) die("<script type='text/javascript'>alert('Pastikan Data Terisi');history.go(-10);</script>");
- include ("./pengaturan/conn.php");
- $query1 = "insert into pemenang " . "(Nomor,Nama,Unit,Kupon,Hadiah) " . " values ('$Nomor','$Nama','$Unit','$Kupon','$Hadiah')";
- $hasil1 = mysql_query($query1);
- $query2 = "delete from tbl_hadiah " . "where Id = '$Id1'";
- $hasil2 = mysql_query($query2);
- $query3 = "delete from tbl_peserta " . "where Id = '$Id2'";
- $hasil3 = mysql_query($query3);
- if (($hasil1 == TRUE) and ($hasil2 == TRUE) and ($hasil3 == TRUE))
- {
- echo"<script type='text/javascript'>window.location.href='index.php';</script>";
- }
- else
- {
- echo"<script type='text/javascript'>alert('Gagal');window.location.href='index.php';</script>";
- }
- mysql_close($koneksi);
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement