Advertisement
Guest User

Untitled

a guest
Jun 10th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $user = "root";
  4. $pass = "yuli";
  5. $db = "smartschool";
  6. $con = mysqli_connect($host,$user,$pass,$db) or die("Koneksi Gagal!");
  7. $name = $con->real_escape_string($_POST['fullname']);
  8. echo $name;
  9. //var_dump($name);
  10. //echo "|";
  11. $nisn = $con->real_escape_string($_POST['nisn-siswa']);
  12. echo $nisn;
  13. //var_dump($nisn);
  14. //echo "|";
  15. $pass = $con->real_escape_string($_POST['pass']);
  16. echo $pass;
  17. //var_dump($pass);
  18. //echo "|";
  19. $kelas = $con->real_escape_string($_POST['kelas']);
  20. echo $kelas;
  21. //var_dump($kelas);
  22. //echo "|";
  23. $agama = $con->real_escape_string($_POST['agama']);
  24. echo $agama;
  25. //var_dump($agama);
  26. //echo "|";
  27. $jk = $con->real_escape_string($_POST['jk']);
  28. echo $jk;
  29. //var_dump($jk);
  30. //echo "|";
  31. $tmplhr = $con->real_escape_string($_POST['tmp-lhr']);
  32. echo $tmplhr;
  33. //var_dump($tmplhr);
  34. //echo "|";
  35. $tgllhr = $con->real_escape_string($_POST['tgl-lhr']);
  36. echo $tgllhr;
  37. //var_dump($tgllhr);
  38. //echo "|";
  39. $tglmsk = $con->real_escape_string($_POST['tgl-msk']);
  40. echo $tglmsk;
  41. //var_dump($tglmsk);
  42. //echo "|";
  43. $nohp = $con->real_escape_string($_POST['nohp']);
  44. echo $nohp;
  45. //var_dump($nohp);
  46. //echo "|";
  47. $alamat = $con->real_escape_string($_POST['alamat']);
  48. echo $alamat;
  49. //var_dump($alamat);
  50. //echo "|";
  51.  
  52. //$query ="UPDATE `login` SET `password` = '$pass' WHERE `Username` = '$nisn';";
  53. $query1 ="UPDATE siswa
  54. SET password = '".$pass."',
  55. nama_siswa = '".$name."',
  56. id_kelas = '".$kelas."',
  57. agama = '".$agama."',
  58. jk = '".$jk."',
  59. tmp_lahir = '".$tmplhr."',
  60. tgl_lhr = '".$tgllhr."',
  61. tgl_masuk = '".$tglmsk."',
  62. no_hp = '".$nohp."',
  63. alamat = '".$alamat."'
  64. WHERE nisn = '".$alamat."'";
  65.  
  66. //$success = $con->multi_query($query);
  67. $success1 = mysqli_query($con, $query1);
  68.  
  69. if (!$success1) {
  70. die("Couldn't enter data: ".$con->error);
  71.  
  72. }
  73. //if (!$success) {
  74. // die("Couldn't enter data: login".$con->error);
  75.  
  76. //}
  77.  
  78.  
  79.  
  80. header("location: ..\index.php");
  81.  
  82. $con->close();
  83.  
  84. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement