Jump to content

drivethru

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

drivethru's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a PHP upload script that seems to work fine, but my php settings only allow for a 2MB upload limit. I cannot change this setting because I am using a shared server and cannot change php.ini. I can use ftp to upload files but users will have to log in via ftp and upload their files that way. I just want a simple, user-friendly script that users can upload their files by just finding their file by using the "browse" method and just clicking an upload button. Is there anyway to make this possible?
  2. No, i didnt use anything. I just assume that php.ini was included with vdeck and I just have to modify it some.
  3. I tried searching for it and it comes back with no results. Do you have to create the file or is it already included if you have php?
  4. I'm trying to get a file uploader to work and it says I need to change the max file size in my php.ini. Can anybody tell me where php.ini is located in vdeck?
  5. I tried that. I changed it the location of where the file is bein sent. It says that the file uploaded, but it does not show up in my upload folder.
  6. thanks for the help. But how can I send my uploaded file to my "upload" folder?
  7. I need help creating a file upload script. I need users to be able to upload mpeg files only. Users will also need to be logged in by a username/password system. How can users upload files and also will let me know who uploaded the file? Any help will be greatly appreciated!
  8. Here's what I have on my page to check to see if the user is logged in. [code] <?php require 'db_connect.php'; if ($logged_in == 0) { die('Sorry you are not logged in, this area is restricted to registered members. <a href="login.php">Click here</a> to log in.'); } // show content $db_object->disconnect(); // when you are done. ?> [/code] Here is my uploader I also have a configuration file [code] <?php require_once('SFUConfig.php'); require_once('functions.php'); if (SFU_CHANGE_LNG === true and isset($_GET['language'])) {   $temp_language = strtolower($_GET['language']);   if (!file_exists("$temp_language.lng")) {       require_once("$language.lng");       echo "($temp_language.lng) $txt[lng_doesnot_exist]<br />";       echo $txt['lng_fall_default'];   } else {       $language = $temp_language;   } } require_once("$language.lng"); $keys = array_keys($allowed); foreach($keys as $one)   if (!in_array(strtolower($one), array('text', 'exec', 'image', 'package'))) {       html_header();       echo '<p align="center"><span style="color:red; font-size: 12pt;"><b>'.$txt['unknown_attr'].': '.$one.'<br />'.$txt['unknown_notify'].'</b></span></p>';       html_footer();       exit;   } if (SFU_CHANGE_NUM === true && isset($_GET['num_files']) && is_numeric($_GET['num_files']))   $num_files = (int)$_GET['num_files']; foreach($allowed as $notyet)   foreach($notyet as $final)       $flat_allowed[] = strtolower($final); html_header(); if (SFU_PROTECT == true) {   session_start();   if (isset($_POST['SFU_Protect'])) {       if ($_POST['SFU_Protect'] == SFU_PASSWORD)         $_SESSION['SFU_Protect'] = SFU_PASSWORD;       else {         echo $txt['pass_wrong'];         html_footer();         exit;       }   } elseif (!isset($_SESSION['SFU_Protect'])) {       protectForm();       html_footer();       exit;   } elseif ($_SESSION['SFU_Protect'] !== SFU_PASSWORD) {       session_unset();       session_destroy();   } } if (isset($_POST['SFUsubmit'])) {   for ($i = 0; $i < $num_files; $i++) {           if ($_FILES['SFUfile']['name'][$i] == '')           continue;       $File = strtr(stripslashes($_FILES['SFUfile']['name'][$i]), '\'" |\\/?!*#', '__________');       $dotpos = strrpos($File, '.');       $length = strlen($File);       $ext    = strtolower(substr($File, -($length - $dotpos - 1)));       $noext  = substr($File, 0, -($length - $dotpos - 1));           if (!in_array($ext, $flat_allowed)) {           LogErrors("{$txt['extension']} <b>$ext</b> {$txt['not_allowed']}");           continue;         }         switch($_FILES['SFUfile']['error'][$i]) {             case 0:               break;             case 1:               LogErrors($txt['PHP_file_size']);               continue 2;               break;             case 2:               LogErrors("$txt[file_size] $txt[exceded_limit]");               continue 2;               break;             case 3:               LogErrors($txt['partial_upload']);               continue 2;               break;             case 4:               LogErrors($txt['no_file']);               continue 2;               break;         }             if ($_FILES['SFUfile']['size'][$i] > (SFU_MAXSIZE * 1024)) {           LogErrors($txt['file_size'].' ('.round($_FILES['SFUfile']['size'][$i]/1024, 2)." $txt[KB]) {$txt['not_allowed']}");           continue;         }         $fullname = SFU_REALPATH.$File;         if (!isset($content))           $content = '';         if (SFU_OVERWRITE == false or !isset($_POST['SFUoverwrite'])) {           if (file_exists($fullname)) {               LogErrors($txt['file_exists']);               continue;           }           if (isset($allowed['exec']) and in_array($ext, $allowed['exec'])) {               if ($ext == 'php' and $highlight_php == true and file_exists(SFU_REALPATH.$noext.'html')) {                 LogErrors($txt['exec_file_exists']);                 continue;               } elseif (file_exists(SFU_REALPATH.$noext.'txt')) {                 LogErrors($txt['exec_file_exists']);                 continue;               }           }         }         if(@move_uploaded_file($_FILES['SFUfile']['tmp_name'][$i], $fullname)) {             if (isset($allowed['image']) and in_array($ext, $allowed['image']))               is_image();                     elseif (isset($allowed['text']) and in_array($ext, $allowed['text']))               is_text();                   elseif (isset($allowed['exec']) and in_array($ext, $allowed['exec']))               is_exec();             elseif (isset($allowed['package']) and in_array($ext, $allowed['package']))               $uploaded[] = $File;             if ($change_mode == true)               @chmod($fullname, $mode)or               LogErrors($txt['chmod_fail']);           } else {             LogErrors($txt['move_failiur'].'<br />'.$txt['try_again']);             if (!file_exists(SFU_REALPATH))               echo '<span style="color:red; font-size: 12pt;"><b>'.$txt['doesnot_exist'].'</b></span><br />';             elseif (!is_writable(SFU_REALPATH))               echo '<span style="color:red; font-size: 12pt;"><b>'.$txt['unwritable'].'</b></span><br />';         }   }   if ($show_error_log == true and isset($errors) and count($errors) > 0)       ShowErrorLog($errors);   if ($show_uploaded_list == true and isset($uploaded) and count($uploaded) > 0)       ShowUploaded($uploaded);   if (isset($content))       echo $content;   if ($show_upload_form == true)       PrintForm();   if ($notify_admin == true)       MailUploaded();   if ($log_upload == true)       FilesLogging(); } else   PrintForm(); html_footer(); clearstatcache(); ?> [/code] [b]EDITED by ZANUS - Try and use the code tags for such long code or any at that[/b]
  9. That sounds like a really good idea. How do I get it to rename the file? Sorry, I'm still new to PHP.
  10. If this helps any, I'm using Simplicity oF Upload to upload my files. It sends me an email when a file is uploaded anyway. How can I get the username to show up in the email?
  11. Thanks, but I'm still not real sure of what I'm supposed to do. Do I place that code in my "upload.php" or somewhere else and where will the name show up at?
  12. Hey, I have an upload system on my website that allows people to upload files to the site. I have added a username/password system to the site since then. Users have to login to upload a video. Usernames are stored in a mySQL database. When users upload a file, how can I get their username shown to me so I know who sent me the file?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.