sater12

script php

Apr 10th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. include "koneksi.php";
  3.  
  4. $npm_ketua=$_POST['npm_ketua'];
  5. $npm_wakil=$_POST['npm_wakil'];
  6.  
  7.  
  8.  
  9. $cek_dulu_npm_ketua_wakil=mysql_query("SELECT * FROM kandidat WHERE npm_ketua='$npm_ketua' or npm_wakil='$npm_wakil' AND npm_ketua='$npm_ketua' or npm_wakil='$npm_wakil'");
  10. $found = mysql_num_rows($cek_dulu_npm_ketua_wakil);
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. if(($npm_ketua >= 13320001 AND $npm_ketua <= 13320130) AND ($npm_wakil >= 13320001 AND $npm_wakil <= 13320130 )){
  21. if($found == 0){
  22. echo "simpan data";
  23. }
  24. else{
  25. echo "<script>alert('npm sudah terdaftar gunakan npm yang lain');document.location='form_kandidat.php';</script>";
  26. }
  27. }
  28. else{
  29. echo "<script>alert('npm tidak terdaftar');document.location='tampil.php';</script>";
  30. }
  31. ?>
Add Comment
Please, Sign In to add comment