Basically you have to create a <form> and there must be multipart/form-data to upload a file.
Something like:
<html>
<body>
<form action="upload_file.php" method="post">
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</input></br></input></form>
</body>
</html>
And in the PHP file something like that:
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
</br></br></br></br>
But is better you read: http://www.w3schools.com/php/php_file_upload.asp