<?php
include "connect.php";
$nim  		= $_POST['nim'];
$nm_mhs   	= addslashes($_POST['nm_mhs']);
$tingkat   	= $_POST['tingkat'];
$kelas   	= $_POST['kelas'];
$semester   = $_POST['semester'];
$kota_lhr  	= $_POST['kota_lhr'];
$tgl_lhr   	= $_POST['tgl_lhr'];
$agama     	= $_POST['agama'];
$jenkel    	= $_POST['jenkel'];
$alamat    	= $_POST['alamat'];
$telp      	= $_POST['telp'];
$wali       = $_POST['wali'];
$prog_study = $_POST['prog_study'];
$tmpFile   	= fopen($_FILES['photo']['tmp_name'], 'rb');
$fileData  	= fread($tmpFile, filesize($_FILES['photo']['tmp_name']));
$fileData  	= addslashes($fileData);
$angkatan	= $_POST['angkatan'];
$status		= $_POST['status'];
//simpan data
$input ="insert into mhs(nim,nm_mhs,tingkat,kelas,semester,kota_lhr,tgl_lhr,agama,jenkel,alamat,telp,wali,prog_study,photo,angkatan,status)
 values('$nim','$nm_mhs','$tingkat','$kelas','$semester','$kota_lhr','$tgl_lhr','$agama','$jenkel','$alamat','$telp','$wali','$prog_study','$fileData','$angkatan','$status')";
mysql_query($input);
if ($input)
{
header("location:tampilmhs.php");
}
else
{
echo "Poses Input Gagal";
}
//}
?>

