Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    File upload with member login

    I already have a working file upload, thanks to many of you who helped me. It's a small site just for my local office (not going public). I was wanting to create a member log-in, onced logged in they would have their own folder to save and upload files to. I am aware this requires a database, I do have access 2010 so creating on won't be a problem. I just need to know what kind of code I would use as well as what needs to be listed in the database for it to communicate with the code. If you have had any experience with what I am trying to do I would appreciate your help.

    Thanks,

    Neu

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    As you have posted this in the PHP forum I assume you want your users to access their data via the internet. In which case I suggest you look into MySql (or similar) rather than Access. It is free and is normally installed and available alongside PHP.

    I recommend the book "PHP and MySQL.." by Larry Ullman. You need to create the database, create forms to allow people to log-in, validate and secure passwords, remember the user while they remain logged in, etc..

    It is possible to use an Access database in combination with a SharePoint Server to achieve the same thing. This will cost money, although I don't know how much.

    The degree of difficulty in implementing either of the two options above is probably similar. (Well.. Access/SharePoint would require less programming..) But if you've already made some progress with PHP then perhaps look into the first MySql option.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    neusight (08-06-2012)

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks. Do you know of an online demo for this. My server has mysql capabilities. Do you know what I would use to edit or a code mysql database? Yes, I do have an online PHP upload system that works great... I just do not know where to begin as this is a new challenge for me. As for most of us programmers we all love challenges, so needless to say I am very excited in taking on this task.

  • #4
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    I don't know of an online demo - it's not the sort of thing that could be demonstrated in a browser (client side)(?). I would have a look through the stickies for this or the MySql forum.

    You can use phpMyAdmin or a command-line/ console application to create a database. But the first step would be to set an (admin) user and password.

    The steps you will go through are slightly different server-side and locally. Hosted web-servers usually have their own interface for MySql (perhaps a modified version of phpMyAdmin).
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    neusight (08-06-2012)

  • #5
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Yeah, I have completed a database with username and password. I apologize for not making this clear, but you are right, it will be a web based php log-in system.

  • #6
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Here's some exciting (My)SQL for you to study:

    Code:
    CREATE DATABASE Andy2;
    USE Andy2;
    CREATE TABLE users (
        user_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        user_name VARCHAR(30) NOT NULL,
        email VARCHAR(80) NOT NULL,
        pass CHAR(80) NOT NULL,
        active CHAR(32),
        registration_date TIMESTAMP NOT NULL,
        PRIMARY KEY (user_id),
        UNIQUE KEY (user_name), 
        UNIQUE KEY (email),
        INDEX login (user_name, pass)
    );
    
    USE Andy2;
    CREATE TABLE bookmarks (
        book_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        user_id INT UNSIGNED NOT NULL,
        address VARCHAR(500) NOT NULL,
        title VARCHAR(50),
        tags VARCHAR(100),
        description VARCHAR(255),
        created TIMESTAMP NOT NULL,
        PRIMARY KEY (book_id),
        INDEX (user_id),
        INDEX (title),
        UNIQUE KEY usersbooks (user_id, address),
        FOREIGN KEY (user_id) REFERENCES users(user_id)
            ON DELETE CASCADE
    );
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #7
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    great, this code creates a user Andy? and communicates to the database correct

  • #8
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I was told to create a CMS from a friend, would this replace the database? or be in use of both the cms and the mysql?

  • #9
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Quote Originally Posted by neusight View Post
    great, this code creates a user Andy? and communicates to the database correct
    No. The username and password already exist. Notice the first line

    Code:
    CREATE DATABASE Andy2;
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #10
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Quote Originally Posted by neusight View Post
    I was told to create a CMS from a friend, would this replace the database? or be in use of both the cms and the mysql?
    A CMS (content management system) is essentially a database, but it stores and manages documents or files, rather than simple data.

    If you are creating a database for users to upload and access files then I suppose you could say that you are creating a CMS . Might sound better on a CV.

    Wiki
    A content management system (CMS) is a computer system that allows publishing, editing, and modifying content as well as site maintenance from a central page. It provides a collection of procedures used to manage workflow in a collaborative environment. These procedures can be manual or computer-based.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS


  •  

    Tags for this Thread

    Posting Permissions

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