ken15
Эксперт
Дата регистрации:
11.05.2012 19:59:33
Сообщений: 89
<?php
require_once "lib/functions.php";
session_start();
if(isset($_POST['file'])) {
$blacklist = array(".php", ".phtml", ".php3", ".php4", ".html", ".htm"
foreach ($blacklist as $item)
if(preg_match("/$item\$/i", $_FILES['somename']['name'])) exit;
$type = $_FILES['somename']['type'];
$size = $_FILES['somename']['size'];
if (($type != "audio/mp3" && ($type != "audio/wma" && ($type != "audio/wav" exit;
if ($size > 102400) exit;
$uploadfile = "musi/".$_FILES['somename']['name'];
move_uploaded_file($_FILES['somename']['tmp_name'], $uploadfile);
}
if (!checkUser($_SESSION["login"], $_SESSION["password"])) {
header("Location: index.php"
exit;
}
?>
<form action = "" method = "post" enctype = 'multipart/form-data'>
<input type = "file" name = "somename" />
<input name = 'file' id = 'submit' type = "submit" value = "Загрузить" />
</form>
михаил, вот я делаю загрузку файлов на сайт в чем проблема