SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Downloads.

  1. #1
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Downloads.

    I would like to know any opinions on how to have a downloads section with out the people actually knowing where my downloads are stored on the server. I was thinking about have the location of the download in a varible but i do not know if there is some sort of open or download function in php. Any suggestions would be appreciated or functions i can look up would be appreciated. Im looking for something like they have in phpNuke.

  2. #2
    Digital Warrior Renegade's Avatar
    Join Date
    Nov 2000
    Location
    Portland, OR
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never used phpnuke, so I don't know anything about that.

    you can go to HotScripts and check out their download scripts, see if there is anything you like.

    Usually, from what I have seen anyway, a download script works like this.

    1) you create a link to a single script. with a parameter for the file you want to download. for instance:

    <a href="download.php?file=24">ClIcKy lInKy</a>

    2) the script receives that info, looks up the full filename of file #24, and sends it to the browser.

    Is that what you are looking for?

    The hotscripts website uses something similar to this on their site.

    good hunting..

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHPNuke, I believe, uses the same basic concept: store each downloadable file as a reference in the DB, and call upon a certain script with an ID number in the querystring...the script redirects the user to the file, and they are none the wiser. So, in short: if you want to do what PHPNuke does, go with something like Renegade has described.

  4. #4
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ok.......

    so im probably going to need to involve some java into this so i can redirect?

  5. #5
    SitePoint Enthusiast kcabobert's Avatar
    Join Date
    Aug 2001
    Location
    Topeka, KS
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    header("Location: blah.php");

    that will redirect, if it is called first thing in the file.
    Microsoft's Motto: Resistance is futile, you will be assimilated.

    My dog's name is Jade; she is a Miniature pinscher.
    Click here to see some of her pictures

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, not the first thing in the file: just before any output...any HTML or text printed to the screen. You can assign variables and run conditionals and such beforehand...which is probably a good idea, to make sure all the necessary querystring variables are present.

    Anyway, it would be JavaScript as an alternative, as opposed to Java (although you may have just meant Java in a shorthand manner). You could also use an HMTL META tag redirect...so you've got lots of options.


Bookmarks

Posting Permissions

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