
HTTP POST? ?? HTML ? PHP? ??? ?? ?? ???
?? ??? ??? ????? ??? ??? ?? ??? ?? ??? ??? ???? ? ????. ??? ?? ??. ??? ?? ?? ???? ? ????? ? ??? ?? ??? ????? ??? ?? ??? ?????.
HTML5??? , ???? ?? ?? ???? ?? ??? ??? ? ????. PHP ????? ?? ????? ?? ??/?? ??? ??? ??? ???? ?? ?????.
?? PHP ? HTML ?? ??? ?? ?? ???? ?????.
<!doctype html>
<html>
<body>
<form method="post" enctype="multipart/form-data">
<input type="file" name="my_file[]" multiple>
<input type="submit" value="Upload">
</form>
</body>
</html>
In PHP ????:
if (isset($_FILES['my_file'])) {
$myFile = $_FILES['my_file'];
$fileCount = count($myFile["name"]);
for ($i = 0; $i < $fileCount; $i++) {
echo "<p>File #".($i+1).":</p>";
echo "<p>Name: ".$myFile["name"][$i]."<br>";
echo "Temporary file: ".$myFile["tmp_name"][$i]."<br>";
echo "Type: ".$myFile["type"][$i]."<br>";
echo "Size: ".$myFile["size"][$i]."<br>";
echo "Error: ".$myFile["error"][$i]."<br>";
}
}
? ????? ???? ??? ???? ? ??? ??, ?? ??, ??? ?? ??? ?????. ?? ? ??? ??. ?? ?? ??, ???? ?? ??, ??? ??? ???? ???? ? ??? ???? ?? ??? ?? ?? ??? ??? ?? ?????.
? ??? HTML? PHP? ???? ?? ?? ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!