Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("config.php"); ?>
- <script>
- function showsiswa() {
- if (window.XMLHttpRequest) {
- xhttp = new XMLHttpRequest();
- }
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200){
- }
- };
- xhttp.open("GET", "index.html", true);
- xhttp.send();
- }
- </script>
- <?php
- if(isset($_POST['daftar'])) {
- $nama = $_POST['nama'];
- $alamat = $_POST['alamat'];
- $jk = $_POST['jenis_kelamin'];
- $agama = $_POST['agama'];
- $sekolah = $_POST['sekolah_asal'];
- $sql = "INSERT INTO calon_siswa (nama, alamat, jenis_kelamin, agama,sekolah_asal) VALUE ('$nama', '$alamat', '$jk', '$agama', '$sekolah')";
- $query = mysqli_query($db, $sql);
- if( $query ) {
- header('Location: index.php?status=sukses');
- } else {
- header('Location: index.php?status=gagal');
- }
- }
- else {
- die("Akses dilarang...");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment