TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
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
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:42 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design