View Single Post
Old 05-09-2008, 10:21 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default File upload forms dont work for me anymore

Yeah thats right, it doesnt, its like stuff has to work randomly for me, I can never get anything right. I hate this bullshit.

heres the php shit code:
PHP Code:
// PHP sucks


    
echo "<div class=\"FORM_FILE\">";
    echo 
"<form name=\"UPLFRM\" enctype=\"multipart/form-data\" method=\"POST\" action=\"\">
    <h5>Title</h5>
    <input type='text' name='title' size='51' />
    <h5>File</h5>
    <input type='file' name='file' size='50' />
    <h5>Description</h5>
    <textarea cols=\"51\" rows=\"5\" name=\"desc\"></textarea>
    
    <input type=\"submit\" name=\"subpit\" />
    </form>
    "
;

    echo 
"</div>";
    
    
$title $_POST['title'];
    
$desc $_POST['desc'];
    
$file $_FILES['file'];
    
$name $file['name'];
    
$size $file['size'];
    
$path $file['tmp_name'];
    
$type $file['type'];
    
$submit $_POST['subpit'];
    
$date time();
    


    
    
$new_path FILE_DIRECTORY md5($name) . $type;
    
    
    
    if (
$submit)
    {
    
// This doesnt even work, see, usually php works like this, // but now it doesnt.
            
if (!strstr($type,'rar') || !strstr($type,'zip') || !strstr($type,'lua'))
    {
        
      echo (
'This is not a RAR|ZIP|LUA formatted File!');    
    }
        
        if (
$title != "" 
        
&& $desc != "" 
        
&& $name != ""
        
&& strstr($type,'rar')
        || 
strstr($type,'zip')
        || 
strstr($type,'lua'))
        {
            
            if (
move_uploaded_file($path,$new_path))
            {
                
            }
            
        }
        
        
    } 
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote