<?php
include "connect.php";
$nik   = $_POST['nik'];
$nama   = $_POST['nama'];
$jabatan  = $_POST['jabatan'];
$telp   = $_POST['telp'];
$alamat     = $_POST['alamat'];
$tmpFile   = fopen($_FILES['photo']['tmp_name'], 'rb');
$fileData  = fread($tmpFile, filesize($_FILES['photo']['tmp_name']));
$fileData  = addslashes($fileData);
$kota_lhr = $_POST['kota_lhr'];
$tgl_lhr = $_POST['tgl_lhr'];
$tgl_msk = $_POST['tgl_msk'];
//simpan data
$input ="insert into staf(nik,nama,jabatan,telp,alamat,photo,kota_lhr,tgl_lhr,tgl_msk)
 values('$nik','$nama','$jabatan','$telp','$alamat','$fileData','$kota_lhr','$tgl_lhr','$tgl_msk')";
mysql_query($input);
if ($input)
{
header("location:userhrd.php");
}
else
{
echo "Poses Input Gagal";
}
//}
?>

