The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 2 of 2

Thread: PHP Members Login

  1. #1

    PHP Members Login

    Hello Kirupa Community:

    I'm creating a login section using the following tute:

    I have files that will be available for members to download, but how can I display the correct file for each member?

    I was thinking that I could upload the files, and then reference the URLs from mySQL... am I on the right track?

    If anyone has a better suggestions... I'm all ears.

    Thank you!

  2. #2
    You're on the right track. You'll have to append some sort of unique token to each file upload per user... so say user1 uploads foobar.pdf and user2 uploads foobar.pdf... you can do a couple things.

    When they upload you can append their user id (since they will be unique) to the file name so it would be 1_foobar.pdf or 2_foobar.pdf.

    The other option would be to give each user a folder that it gets uploaded to, again... you'd prolly want to create the folder based off the users id or the users name.
    folder user 1
    -- foobar.pdf

    folder user 2
    -- foobar.pdf

    then for your sql insert just have a files table or something like that, has
    file_id, user_id, file_name

    file id auto increments
    user id is the id of the person who uploaded it
    and file name is simply just the file they uploaded
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012