Advertisement
Guest User

Untitled

a guest
May 29th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. if($user_data['maresef'] == 1 || $user_data['sefmaimic'] == 1 || $user_data['furnicuta'] == 1){
  2. if (empty($_POST) === false && empty($errors) === true) {
  3. if (isset($_POST['upload'])){
  4.  
  5.     $name = sanitize($_POST['name']);
  6.     $genre = sanitize($_POST['genre']);
  7.     $cat = sanitize($_POST['cat']);
  8.     $trailer = sanitize($_POST['trailer']);
  9.     $descr = sanitize($_POST['descr']);
  10.     $date = date('y.m.d');
  11.     $aut_id = sanitize($_POST['aut_id']);
  12.     $unique_key = md5(date('y.m.d') + microtime());
  13.     if(empty($_POST['terms']) === true){
  14.     $auth = $_POST['auth'];
  15.     }else{
  16.     $auth = $_POST['auth2'];
  17.     }
  18.     if(empty($_POST['sursas']) === true){
  19.     $sursas = $_POST['sursa'];
  20.     }else{
  21.     $sursas = $_POST['sursa2'];
  22.     }
  23.  
  24.  
  25. if (isset($_FILES['torr']) === true){
  26.  
  27.         $allowed = array('torrent');
  28.         $file_name = $_FILES['torr']['name'];
  29.         $file_extn = strtolower(end(explode('.' ,$file_name)));
  30.         $file_temp = $_FILES['torr']['tmp_name'];
  31.         if(in_array($file_extn, $allowed) === true){
  32.         $file_path              = 'media/torr/' . $name . '-www.LegacyRo.info-' .substr(md5(time()), 0, 10) . '.' . $file_extn;
  33.         move_uploaded_file($file_temp, $file_path);
  34.    
  35.    
  36. }
  37.  
  38.  
  39.  mysql_query("INSERT INTO torenturi (name, genre, cat, trailer, descr, date, torr, aut_id, auth, sursa, unique_key)
  40. VALUES
  41. ('$name', '$genre', '$cat', '$trailer', '$descr', '$date', '$file_path', '$aut_id', '$auth', '$sursas', '$unique_key')");
  42.  
  43.   }
  44. }
  45. header('Location: upload.php?succes');
  46. }
  47. else if(empty($errors) === false){
  48. echo output_errors($errors);
  49.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement