...

View Full Version : File upload with member login



neusight
08-06-2012, 02:28 PM
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

AndrewGSW
08-06-2012, 02:58 PM
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.

neusight
08-06-2012, 09:11 PM
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.

AndrewGSW
08-06-2012, 09:26 PM
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).

neusight
08-06-2012, 09:29 PM
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.

AndrewGSW
08-06-2012, 09:31 PM
Here's some exciting (My)SQL for you to study:


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
);

neusight
08-06-2012, 09:45 PM
great, this code creates a user Andy? and communicates to the database correct

neusight
08-06-2012, 09:48 PM
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?

AndrewGSW
08-06-2012, 10:26 PM
great, this code creates a user Andy? and communicates to the database correct

No. The username and password already exist. Notice the first line :p


CREATE DATABASE Andy2;

AndrewGSW
08-06-2012, 10:29 PM
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 :D. 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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum