Jump to content

AncientSage

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by AncientSage

  1. I have a file upload script, the php works perfectly, and the HTML part of it can upload small files without problem, but when it comes time to upload a file such as an Mp3, it is not getting it (as the php is executing as it should). The HTML script is as follows... [code] <form action="{FORM_ACTION}" method="post" enctype="multipart/form-data"> <input type="file" name="ufile"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <br> <input type="submit" value="Upload"> </form> [/code] Thanks for any help... Note: Ignore {FORM_ACTION}, it's defined in php.
  2. I'd guess there are a few ways to do this... You could have the inputted password checked against the actual password, if the two are not equal, reload the login form. If the script is equal, you could store it in a session, then have each page within the protected directory check the session variables or something.
  3. Hello, I've got an HTML/PHP upload script, the script uploads to an external server via FTP, however, when trying to upload bigger files (over a few MB) then the script times out. Smaller files work easily though, anyway, does anyone know of a solution for such a problem? Also, I use ... [code] <input type="hidden" name="MAX_FILE_SIZE" value="10000"> [/code] ...for the max file size, I'd assume that's in KB not bytes, right? Would it be better to use php instead of this to determine the max file size? Thanks. Note: I do not have access to a php.ini file if it is needed...
  4. Ah. Well, being slightly new to PHP, would I use a foreach loop to do so? 
  5. [code] Warning: preg_match() expects parameter 2 to be string, array given [/code] Hello, the above is the error I am receiving, this is the function... [code] function audio_files($filelist) {   $clean_files = array();   $extensions = array('\.mp3', '\.aiff', '\.wav', '\.mid'); //add audio extensions   $read_extensions = '(' . implode('|', $extensions) . ')';   if(preg_match("#$read_extensions$#", $filelist))   {       $clean_files[] = $filelist;   }   return $clean_files; } [/code] Note, $filelist contains ftp_nlist(). Now, I'm guessing this could be a problem with my web host, so I'll go 'head and post that to. [code] cPanel 10.8.1-STABLE_31 (PRO 1.0 (RC2)) Apache Core 1.3.34 SpamAssasin 3.1 phpMyAdmin 2.6.1-rc1 PHP 4.4.1 AND 5.0.5 PERL 5.8.6 MySQL 4.1.13-standard-log Processor Name: Intel(R) Celeron(TM) CPU 2.40GHz Processor speed: 2394.027 MHz Processor cache size: 128 KB Operating System: RedHat Enterprise 3 Memory Information: ECC Registered 1024 MB RAM [/code] If anyone could resolve the preg_match() error I am having, please do so...help is appreciated.
×
×
  • 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.