Put this code in php file
<?php
$uploaddir='../uploads/';
$uploadfile=mysql_prep($uploaddir.basename($_FILES['uploadfile']['name']));
if(move_uploaded_file($_FILES['uploadfile']['tmp_name'], $uploadfile))
{
$name=mysql_prep(($_FILES['uploadfile']['name']));
$type=mysql_prep(($_FILES['uploadfile']['type']));
$data=($uploadfile);
$size= intval($_FILES['uploadfile']['size']);
#echo $data;
$branch=mysql_prep($_POST['branch']);
$sem=mysql_prep($_POST['sem']);
$query="INSERT INTO upload_file (name,type,data,size,created,branch_id,sem_id) VALUES ('{$name}','{$type}','{$data}','{$size}',NOW(),'{$branch}','{$sem}')";
$result=mysql_query($query);
if($result){
echo"<h2>file successfully uploaded<h2>";
redirect_to(root."afterlogin/upload.php?spload=0112");
}
else{
echo" the file you insert can't be uploaded";
}
and include this to html file
<?php if(isset($_GET['spload'])){
$upload_process="you have successfully uploaded your file. ";
$upr=1;
}else{
$upr=0;
}
?>