View file load/uploadfile.php

File size: 10.05Kb
<?php
include "main/cfg.php";
$verh='<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" 

"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>mp3</title><link rel="stylesheet" href="main/css/'.$style.'" type="text/css"/>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
</head><body>';
$niz='</body></html>';
print $verh;
////////////////////////
///*******///
 $Obmennik=substr($Obmennik,1);
 if ((!empty($obmennik)) && (!empty($Obmennik))) {
$upmelod = $Obmennik.'/'.$obmennik.'/';/// c 
////////////////////////////////////////////////////////////////////////////////////
///  ///
////////// 

$ext = explode('.',$_FILES['userfile']['name']);
$ext = $ext[count($ext)-1];
$f="/";
$exthtgf=$_FILES['userfile']['name'];
$exthtgf = strip_tags($exthtgf);
$exthtgf = trim($exthtgf);
  $exthtgf=str_replace("$","",$exthtgf);
 $exthtgf=str_replace("quot;","",$exthtgf);
            $exthtgf=str_replace("$","",$exthtgf);
            $exthtgf=str_replace("&lt;","",$exthtgf);
            $exthtgf=str_replace("<","",$exthtgf);
            $exthtgf=str_replace(">","",$exthtgf);
            $exthtgf=str_replace("&gt;","",$exthtgf);
            $exthtgf=str_replace("\"","",$exthtgf);
            $exthtgf=str_replace("'","",$exthtgf);
            $exthtgf=str_replace("\\","",$exthtgf);
            $exthtgf=str_replace("&","",$exthtgf);
             $exthtgf=str_replace("%","",$exthtgf);
              
            $exthtgf=str_replace("@","",$exthtgf);
            $exthtgf=str_replace("^","",$exthtgf);
            $exthtgf=str_replace("*","",$exthtgf);
            $exthtgf=str_replace(")","",$exthtgf);
            $exthtgf=str_replace("(","",$exthtgf);
            $exthtgf=str_replace("|","",$exthtgf);
            $exthtgf=str_replace("!","",$exthtgf);
            $exthtgf=str_replace("№","",$exthtgf);
            $exthtgf=str_replace(";","",$exthtgf);
            $exthtgf=str_replace("/","",$exthtgf);
            $exthtgf=str_replace("{","",$exthtgf);
            $exthtgf=str_replace("}","",$exthtgf);
            $exthtgf=str_replace("[","",$exthtgf);
            $exthtgf=str_replace("]","",$exthtgf);
            $exthtgf=str_replace("#","",$exthtgf);
$replace=@file("main/$dir_opisanie/$exthtgf.dat");
if((!empty($replace))or($exthtgf="")) {print '<div class="bottom"><b>Ошибочка вышла!</b></div><div class="block">
Произошла ошибка! </div><div class="top">
Возможные причины:</br> 1) Недопустипое имя файла<br/> 2) Файл с таким названием уже существует<br/> 3)Вы незаполнели(или использовали недопустимые символы) все поля</br>
<a href="'.$this_file.'?style='.$style.'&amp;ver='.$ver.'&amp;tr='.$tr.'">В обменник</a><br/><a href="'.$this_file.'?ver='.$ver.'&amp;style='.$style.'">На 
главную</a></div><div class="copy">'.$copy.'</div>'; exit;}

$exthtgf = htmlspecialchars(stripslashes($exthtgf));
$komment = htmlspecialchars(stripslashes($komment));
$avtor = htmlspecialchars(stripslashes($avtor));
$komment = strip_tags($komment);
$komment = trim($komment);
  $komment=str_replace("$","",$komment);
 $komment=str_replace("quot;","",$komment);
                     $komment=str_replace("#","",$komment);  
 $komment=str_replace("$","",$komment);
            $komment=str_replace("&lt;","",$komment);
            $komment=str_replace("<","",$komment);
            $komment=str_replace(">","",$komment);
            $komment=str_replace("&gt;","",$komment);
            $komment=str_replace("\"","",$komment);
            $komment=str_replace("'","",$komment);
            $komment=str_replace("\\","",$komment);
            $komment=str_replace("&","",$komment);
             $komment=str_replace("%","",$komment);
              
            $komment=str_replace("@","",$komment);
            $komment=str_replace("^","",$komment);
            $komment=str_replace("*","",$komment);
            $komment=str_replace(")","",$komment);
            $komment=str_replace("(","",$komment);
            $komment=str_replace("|","",$komment);
            $komment=str_replace("!","",$komment);
            $komment=str_replace("№","",$komment);
            $komment=str_replace(";","",$komment);
            $komment=str_replace("/","",$komment);
            $komment=str_replace("{","",$komment);
            $komment=str_replace("}","",$komment);
            $komment=str_replace("[","",$komment);
            $komment=str_replace("]","",$komment);
$avtor = strip_tags($avtor);
$avtor = trim($avtor);
  $avtor=str_replace("$","",$avtor);
 $avtor=str_replace("quot;","",$avtor);
                               $avtor=str_replace("#","",$avtor);
  $avtor=str_replace("$","",$avtor);
            $avtor=str_replace("&lt;","",$avtor);
            $avtor=str_replace("<","",$avtor);
            $avtor=str_replace(">","",$avtor);
            $avtor=str_replace("&gt;","",$avtor);
            $avtor=str_replace("\"","",$avtor);
            $avtor=str_replace("'","",$avtor);
            $avtor=str_replace("\\","",$avtor);
            $avtor=str_replace("&","",$avtor);
             $avtor=str_replace("%","",$avtor);
              
            $avtor=str_replace("@","",$avtor);
            $avtor=str_replace("^","",$avtor);
            $avtor=str_replace("*","",$avtor);
            $avtor=str_replace(")","",$avtor);
            $avtor=str_replace("(","",$avtor);
            $avtor=str_replace("|","",$avtor);
            $avtor=str_replace("!","",$avtor);
            $avtor=str_replace("№","",$avtor);
            $avtor=str_replace(";","",$avtor);
            $avtor=str_replace("/","",$avtor);
            $avtor=str_replace("{","",$avtor);
            $avtor=str_replace("}","",$avtor);
            $avtor=str_replace("[","",$avtor);
            $avtor=str_replace("]","",$avtor);




  
 {for ($i=0; $i<count($Obmennik_endif); $i++)
{if ($ext==$Obmennik_endif[$i])
{
if ((!empty($avtor))&& (!empty($komment)))
$_FILES['userfile']['name'] = strip_tags($_FILES['userfile']['name']);
$_FILES['userfile']['name'] = trim($_FILES['userfile']['name']);
  $_FILES['userfile']['name']=str_replace("$","",$_FILES['userfile']['name']);
 $_FILES['userfile']['name']=str_replace("quot;","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("$","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("&lt;","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("<","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace(">","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("&gt;","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("\"","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("'","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("\\","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("&","",$_FILES['userfile']['name']);
             $_FILES['userfile']['name']=str_replace("%","",$_FILES['userfile']['name']);
              
            $_FILES['userfile']['name']=str_replace("@","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("^","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("*","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace(")","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("(","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("|","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("!","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("№","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace(";","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("/","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("{","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("}","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("[","",$_FILES['userfile']['name']);
            $_FILES['userfile']['name']=str_replace("]","",$_FILES['userfile']['name']);

$_FILES['userfile']['name']=str_replace("#","",$_FILES['userfile']['name']);



$exthtgf=$_FILES['userfile']['name'];
$file2 = fopen("main/$dir_opisanie/$exthtgf.dat","w"); 
fputs($file2, $avtor.'||'.$komment); 

fclose($file2); $uploadfile = $upmelod.$f. basename($_FILES['userfile']['name']);
 save_file ($_FILES,$uploadfile); 
}}}}
print '<div class="bottom"><b>Ошибочка вышла!</b></div><div class="block">
Произошла ошибка! </div><div class="top">
Возможные причины:</br> 1) Недопустипое имя файла<br/> 2) Файл с таким названием уже существует<br/> 3)Вы незаполнели(или использовали недопустимые символы) все поля</br>
<a href="'.$this_file.'?style='.$style.'&amp;ver='.$ver.'&amp;tr='.$tr.'">В обменник</a><br/><a href="'.$this_file.'?ver='.$ver.'&amp;style='.$style.'">На 
главную</a></div><div class="copy">'.$copy.'</div>';



function save_file ($_FILES,$uploadfile){
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print '<div class="bottom"><b>Файл  добавлен</b></div><div class="block">Ваш файл - '.$_FILES['userfile']['name'].' успешно загружен в раздел </div><div class="top">
<a href="'.$this_file.'?ver='.$ver.'&amp;style='.$style.'">На 
главную</a></div><div class="copy">'.$copy.'</div>';
exit;
}}; 
print $niz;
?>