<html>
<head>
<title>Insert Song</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"
enctype="multipart/form-data">
Select the Song : <input type="file" name="file">
<p><input type="submit" name="submit" value="submit"></p>
</form>
</body>
</html>
<?php
include("database.php");
if(isset($_POST['submit']))
{
$name = $_FILES['file']['name'];
echo $name;
$sql = mysql_query("insert into songs (name) values ('$name')");
if($sql)
{
echo "<br>inserted successfully";
}
else
{
echo "<br>not";
}
}
?>
有人向我解释如何从上面的代码中获取PHP文件的详细信息(如名称,艺术家,大小等)。