Closed Thread
Results 1 to 10 of 10

Thread: Upload Form

  1. #1
    scorch94 is offline x10 Sophmore scorch94 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    228

    Exclamation Upload Form

    I am giving 500 credits to anyone who does this job. I need a simple upload form in PHP.
    Let the page be called upload.php. It should contain a browse form and Upload! button. The only extension allowed to be uploaded is .pas

    The file intended to be uploaded should be contained in the same directory as upload.php

    Thanks in advance!

  2. #2
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Upload Form

    Consider this done

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  3. #3
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: Upload Form

    http://www.htmlgoodies.com/beyond/ph...le.php/3472551

    here have a nice tutorial on how to make a simple php upload form
    Better than just make one for you, the nice part is write and learn
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  4. #4
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Upload Form

    PHP Code:
        <?php
        
        
    if (empty($_POST['upload'])) {
            echo 
    '
    <form name="upload" enctype="multipart/form-data" method="POST" action="'
    .$_SERVER['REQUEST_URI'].'">
    <input type="file" name="file" size="13" value="">
    <br /><input type="submit" name="upload" value="Upload">
    </form>
    '
    ;
        } else {
            
    //these variables should be self explanatory
            
    $yourdomain 'http://www.yourdomain.com/';
            
    $uploaddir './';
            
    $filename $_FILES['file']['name'];
            
    $filesize $_FILES['file']['size'];
            
    $tmpname_file $_FILES['file']['tmp_name'];
            
            
            
    $filetype=substr($filename,-4);
            if(
    $filetype==".pas"//now we check the file extension, make sure its a pas file  {
            
    if($filesize '5000000')  //set this to something realistic, pas files should be small
            
    {
                echo 
    "Way too big!!";
            } else {
                
    move_uploaded_file($tmpname_file"$uploaddir$filename");
                echo 
    "Successful.<br /><b>URL: </b><textarea rows='1' cols='13'>".$yourdomain.$uploaddir.$filename."</textarea>";
            }
        } else {
            echo 
    "Not a .pas file";
        }
    }
    ?>

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  5. #5
    scorch94 is offline x10 Sophmore scorch94 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    228

    Re: Upload Form

    Didn't work out I will ask one person tho, so if he makes it first... he gets credits

    I get some errors... syntax errors or so.

    Good luck with the race
    Edit:
    I changed my mind. Anyway you do it or not you can be ensured you have 300 credits If you do it... 500.

    I will give you 300 creds at least because you put your work in this and I appreciate it ;)
    Last edited by scorch94; 11-09-2007 at 02:08 PM. Reason: Automerged Doublepost

  6. #6
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Upload Form

    PHP Code:
        <?php

    if ( empty( $_POST['upload'] ) )
    {
        echo 
    '
    <form name="upload" enctype="multipart/form-data" method="POST" action="' 
    $_SERVER['REQUEST_URI'] . '">
    <input type="file" name="file" size="13" value="">
    <br /><input type="submit" name="upload" value="Upload">
    </form>
    '
    ;
    }
    else
    {
        
    // these variables should be self explanatory
        
    $yourdomain 'http://www.yourdomain.com/';
        
    $uploaddir './';
        
    $filename $_FILES['file']['name'];
        
    $filesize $_FILES['file']['size'];
        
    $tmpname_file $_FILES['file']['tmp_name'];

        
    $filetype substr$filename, -);
        if ( 
    $filetype == ".pas" // now we check the file extension, make sure its a pas file  {
        
    {
            if ( 
    $filesize '5000000' // set this to something realistic, pas files should be small
                
    {
                    echo 
    "Way too big!!";
            }
            else
            {
                
    move_uploaded_file$tmpname_file"$uploaddir$filename);
                echo 
    "Successful.<br /><b>URL: </b><textarea rows='1' cols='13'>" $yourdomain $uploaddir $filename "</textarea>";
            }
        }
        else
        {
            echo 
    "Not a .pas file";
        }
    }

    ?>
    Corrected version. Its not easy to code inside vBulletin =(

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  7. #7
    mr kennedy's Avatar
    mr kennedy is offline KENNNNNEEEEDYYY!!!! mr kennedy is an unknown quantity at this point
    Join Date
    Aug 2007
    Location
    Doha, State of Qatar
    Posts
    525

    Re: Upload Form

    Slothie's right... if you are to code vBulletin, the source code will be coming in handy(it comes when you buy a license). you will have the MySQL table codings, the vB hooks and all those stuff

  8. #8
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Upload Form

    Quote Originally Posted by mr kennedy View Post
    Slothie's right... if you are to code vBulletin, the source code will be coming in handy(it comes when you buy a license). you will have the MySQL table codings, the vB hooks and all those stuff
    You misunderstood me. I meant its hard to code inside these textboxes. vBulletin itself is pretty easy to code in.

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  9. #9
    scorch94 is offline x10 Sophmore scorch94 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    228

    Re: Upload Form

    500 credits will be sent immediately. Mods, lock the thread.

  10. #10
    Christopher's Avatar
    Christopher is offline Retired Christopher is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    USA
    Posts
    7,330

    Re: Upload Form

    Locked.
    You can do it yourself by clicking Thread Tools anc then close thread

Closed Thread

Similar Threads

  1. Design a free form
    By gateway in forum Off Topic
    Replies: 1
    Last Post: 10-19-2007, 05:49 PM
  2. Max php file upload - how to adjust
    By phixer in forum Free Hosting
    Replies: 1
    Last Post: 10-07-2007, 09:15 PM
  3. My php Form tutorial
    By WinGate in forum Tutorials
    Replies: 0
    Last Post: 08-20-2007, 08:14 PM
  4. Frontpage Form Problem
    By geek2009 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-03-2007, 10:18 AM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers