proc_reg.php

From abnormal, 2 Years ago, written in PHP, viewed 313 times. This paste will kick the bucket in 1 Second.
URL https://code.nat.moe/view/9759a7a2 Embed
Download Paste or View Raw
  1. <?php
  2. /*
  3.     proc_reg.php -> daftar.php
  4.     was created on 2020/04/08
  5. */
  6.  
  7. include "config/config.php";
  8.  
  9. if (isset($_POST['submit'])) {
  10.  
  11.     //-------------------------------> START
  12.     $nm_siswa = htmlentities($_POST['namaSiswa']);
  13.     $nm_wali = htmlentities($_POST['namaWali']);
  14.     $username = htmlentities($_POST['username']);
  15.     $password = hash('md5', hash('sha256', $_POST['password']));
  16.     $asal_sklh = htmlentities($_POST['asalSekolah']);
  17.  
  18.     // Jurusan
  19.     if ($_POST['pilihJurusan'] == "1") {
  20.         $jurusan = "Teknik Komputer dan Jaringan";
  21.     } elseif ($_POST['pilihJurusan'] == "2") {
  22.         $jurusan = "Teknik Otomotif";
  23.     } elseif ($_POST['pilihJurusan'] == "3") {
  24.         $jurusan = "Teknik Mesin";
  25.     } else {
  26.         $jurusan = "";
  27.     }
  28.  
  29.     // Prestasi
  30.     if ($_POST['pilihPrestasi']){
  31.         $prestasi = "Rangking " . $_POST['pilihPrestasi'];
  32.     } else {
  33.         $prestasi = "";
  34.     }
  35.  
  36.     $alamat = htmlentities($_POST['alamat']);
  37.     $status = $_POST['status'];
  38.  
  39.     // Upload File
  40.     $upload_dir = "assets/uploads/";
  41.     $allow_ext = "pdf";
  42.     $fileName = $_FILES['ijazah']['name'];
  43.     $fileType = $_FILES['ijazah']['type'];
  44.     $fileTemp = $_FILES['ijazah']['tmp_name'];
  45.     $getExt = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
  46.     $pathFile = $upload_dir . $fileName;
  47.  
  48.     if ($getExt == "pdf" && $fileType == "application/pdf"){
  49.         if (move_uploaded_file($_FILES['userfile']['tmp_name'], $pathFile))
  50.         {
  51.             $statusFile = "";
  52.         }
  53.         else
  54.         {
  55.             $statusFile = "forbidden";
  56.         }
  57.     }
  58.     //-------------------------------> END
  59.  
  60.     if ($statusFile == ""){
  61.         $query = $mysqli->query("[REDACTED]");
  62.         if ($query) {
  63.             echo 'success';
  64.         } else {
  65.             echo 'fail';
  66.         }
  67.     } else {
  68.         echo 'forbidden';
  69.     }
  70. }
  71.  

Replies to proc_reg.php rss

Title Name Language When
Re: proc_reg.php - SOLVED abnormal php 2 Years ago.

Reply to "proc_reg.php"

Here you can reply to the paste above

captcha