Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 9 of 9

Thread: Uploader..

  1. #1
    Join Date
    Apr 2005
    Posts
    4,963
    Tokens
    0

    Latest Awards:

    Default Uploader..

    Right, i can make the basic uploader in php, but i can't get it so if theres 2 files with the same name it will like add a number to one or whatever so you could keep uploading files with the same name without errors.

    Anyone know how to do this ;S

  2. #2
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:


  3. #3
    Join Date
    Apr 2005
    Posts
    4,963
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Luckyrare
    You could of told me this before

  4. #4
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    LYKE OMG! TIS A LEET SITE WWW.PHP.NET K PLS?

    Yeah, php.net is a good site... Just search for the function ect and ta da! Samples and tells you how to use the function.

  5. #5
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Owen
    You could of told me this before
    Just check the files already in there, and if there is one of the same file name return with an error.
    kinda quit.

  6. #6
    Join Date
    Aug 2004
    Posts
    183
    Tokens
    0

    Default

    <?php
    function rand_array($start, $end, $rangemin, $rangemax)
    {
    $array = array_fill($start, $end, 1);

    foreach($array as $key => $value)
    {
    $value = rand($rangemin,$rangemax);
    print "$key: $value<br>\n";
    }
    }

    $start = 1;
    $end = 1000;
    $rangemin = 1;
    $rangemax = 20000;

    rand_array($start, $end, $rangemin, $rangemax);
    ?>

    Pixel Design
    Pencil Design
    Web Coding

  7. #7
    Join Date
    Nov 2004
    Posts
    268
    Tokens
    0

    Default

    Just instead of using file names, encrypt the filename into a number like 6878486.gif etc
    Status:

  8. #8
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Hmm, Graphics, you don't need that lmao

    <?php
    $rand = rand(1,100000);
    $filename = $_POST['file'];
    $upload = $file$rand;
    ?>

    That will do the job if you make the upload form called file, and then rename the uploaded file to $upload



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  9. #9
    Coding4Newbs Guest

    Default

    Lol @ graphics for trying ,

    Like tim omgz i didnt know u knew php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •