PHP /username/custom-uploaded-file-url

Discussion in 'Programming Languages' started by HTML, May 15, 2015.

  1. HTML

    HTML Big Board Coder


    I am working on a website where users can upload audio files, and those audio files are then displayed as a list on their profiles, "johndoe" being my username... (

    How can I make this work? - I need a text box that a user can type in what they want the vanity url to be for that specific upload they are editing / in the process of being uploaded.

    For example, I uploaded audio file cool-drums.mp3. I type "cooldrumsclip" in a textbox for the custom url for that file. I save the form. Now, to visit this audio file, this would be the URL:

    This is an example of my current audio file URLs: , 55 being the track ID.

    Basically, I need to allow the user to define a custom URL for uploads, and for that custom URL to appear after their username like so - (the file URL is originally being index.php&a=track&id={fileID})
  2. Jake

    Jake Developer

    You'll need to make your PHP file accept the name instead of the id, and then use mod_rewrite for the rest.
  3. HTML

    HTML Big Board Coder

    Thanks for your reply. Well, that is obvious. That's the simple part, the other stuff isn't. I'll have to have the URLs be index.php?a=track&u=johndoe&track=audiotitle

    I'll probably have to have the username in there because if 2 users uploaded the same audio file with the same name, that wouldn't work out too well. I guess this is probably the wrong place to ask for help with this, but it was worth a shot :/
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.