I have successfully set up the database and register page. Once my user logs in, the code goes to a page which just says Login Successful. I would like to have it so that the user is immediately redirected to "their" account page to download a spreadsheet that I upload for them each.
Excellent thanks Hamburglar - what if I want each individual to go to their "own" page - for example: Client A logs in and sees AccountA.php - Client B logs in and sees AccountB.php and so on...
I am wanting Mr H to log in then access one page with download links of his invoices and spreadsheet with his data on and Mr B to log in and see his page of download links of invoices and his spreadsheet and so on
I am wanting Mr H to log in then access one page with download links of his invoices and spreadsheet with his data on and Mr B to log in and see his page of download links of invoices and his spreadsheet and so on
Option 1:
Now depending on your knowledge of PHP, you can add all this information in the database. This way when Mr H log's in, he can access his invoice. There should be an admin area to upload the invoice as well.
Option 2:
This is the most basic thing I can think of right now. You can name the invoice file like invoice_username.xls
Grab the username from the session variable and place it there.
Hamburglar - If I wanted to put everything into the database (I have the upload to database feature) then, after Log In, how would I link to, say, Paul.xlsx in the database? I think I agree, I may do it the database way
Hamburglar - If I wanted to put everything into the database (I have the upload to database feature) then, after Log In, how would I link to, say, Paul.xlsx in the database? I think I agree, I may do it the database way
What is the table structure for the uploaded files?
Is the uploaded part connected with a cartain user? or is it just a simple file upload?
It is fine if the table is part of the database. However the database needs to have another table that shows the connection. That table in essence will say "This file belongs to Mr H".
Right now, all your database does it upload files and users. There is no table in your database that links them together. That is what you will need to create.
Now the currently upload file script you are using will need to be modified on 3 levels.
1) Database Table
The table 'file' will need another column that says user_id. This says "File XYZ belongs to this user_id".
2) Admin area.
When you add a file, you will need a drop down or select box that will grab the user_id and attach it to that file.
So for example:
a) You select excelt invoice
b) from drop down you select mr H
c) info gets added into database
3) User interface
When the user logs in, they can access their file by just querying the database. Nothing else to it.
If you are having trouble, I can whip up a script for you tomorrow sometime.
Ah lol - failed at the first hurdle! Added the Column User_ID then went to add a dropdown but then I don't know how to add the list in the dropdown LOL
I have got a For Dummies PHP & MySQL book here, maybe I should read it!! /
You might want to look at some other books as well since Dummies books are like trying to learn how to swim while being in a puddle.
PHP and MySQL Web Development by Luke Welling and Laura Thomson
Murach's PHP and MySQL by Joel Murach and Ray Harris
Beginning PHP and MySQL: From Novice to Professional by W. Jason Gilmore
I have used the first one. I have used Murach's books for Java and tend to be more about making an application and learning bits along the way. apress puts out solid books overall so they get a mention as well.
Bookmarks