mnaufaldillah

proses pendaftaran tugas php

Dec 6th, 2021
702
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include('config.php');
  3.  
  4.     //ambil data dari formulir
  5.     $nama = $_POST['nama'];
  6.     $alamat = $_POST['alamat'];
  7.     $jenis_kelamin = $_POST['jenis_kelamin'];
  8.     $agama = $_POST['agama'];
  9.     $sekolah_asal = $_POST['sekolah_asal'];
  10.  
  11.     //buat query
  12.     $sql = "INSERT INTO calon_siswa(nama, alamat, jenis_kelamin, agama, sekolah_asal) VALUES('$nama', '$alamat', '$jenis_kelamin', '$agama', '$sekolah_asal')";
  13.     $query = mysqli_query($db_connection, $sql);
  14.  
  15.     if ($query) {
  16.         header('Location: index.php?status=sukses');
  17.     }else {
  18.         header('Location: index.php?status=gagal');
  19.     }
  20. ?>
RAW Paste Data