Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($user_data['maresef'] == 1 || $user_data['sefmaimic'] == 1 || $user_data['furnicuta'] == 1){
- if (empty($_POST) === false && empty($errors) === true) {
- if (isset($_POST['upload'])){
- $name = sanitize($_POST['name']);
- $genre = sanitize($_POST['genre']);
- $cat = sanitize($_POST['cat']);
- $trailer = sanitize($_POST['trailer']);
- $descr = sanitize($_POST['descr']);
- $date = date('y.m.d');
- $aut_id = sanitize($_POST['aut_id']);
- $unique_key = md5(date('y.m.d') + microtime());
- if(empty($_POST['terms']) === true){
- $auth = $_POST['auth'];
- }else{
- $auth = $_POST['auth2'];
- }
- if(empty($_POST['sursas']) === true){
- $sursas = $_POST['sursa'];
- }else{
- $sursas = $_POST['sursa2'];
- }
- if (isset($_FILES['torr']) === true){
- $allowed = array('torrent');
- $file_name = $_FILES['torr']['name'];
- $file_extn = strtolower(end(explode('.' ,$file_name)));
- $file_temp = $_FILES['torr']['tmp_name'];
- if(in_array($file_extn, $allowed) === true){
- $file_path = 'media/torr/' . $name . '-www.LegacyRo.info-' .substr(md5(time()), 0, 10) . '.' . $file_extn;
- move_uploaded_file($file_temp, $file_path);
- }
- mysql_query("INSERT INTO torenturi (name, genre, cat, trailer, descr, date, torr, aut_id, auth, sursa, unique_key)
- VALUES
- ('$name', '$genre', '$cat', '$trailer', '$descr', '$date', '$file_path', '$aut_id', '$auth', '$sursas', '$unique_key')");
- }
- }
- header('Location: upload.php?succes');
- }
- else if(empty($errors) === false){
- echo output_errors($errors);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement