PDA

View Full Version : Trying to set up a Client area for my website


KW2912
10-09-2009, 02:40 PM
Hi there,

I am trying to set up a Client area for my website and recently purchased your User Registration software to do this. I've managed to set up the user registration system, database creation, email verification etc and everything is working fab.

Have a look at: http://www.subzerowebsolutions.co.uk/index4.php (The site isn't live yet until I resolve the client area problem)

Now that I have finally managed to set up the User Registration facility I need to create individual pages for all of my registered users - so that once they have logged in using their details from the users mysql database they can click a link to a page which only THEY can see. The "users_Profile.php" page presently has a link to "protected_Page.php" which ALL registered users can see so this isn't ideal for displaying client specific personal data.

As I mentioned - the user registration system worked beautifully but to make it REALLY worth it's money I need to be able to use it to allocate these registered users to seperate pages.

Please can anyone tell me if there is a way of doing this? Thank you

Eric Mittman
10-09-2009, 05:36 PM
If you have got the User Registration Solution Pack implemented then you are on the rite track. You will not need to have a special page for each user, instead this can all be done on a single page that has dynamic content based on the logged in user. This is like the profile page that lists details specific to the current user.

The idea is that you have information stored in the users record or another table in your database that has an association to the user. This is usually done by having a column in the table to hold the user id, this is referred to as a foreign key relationship.

You could then put in custom content on the page based on the user by having a recordset that filters based on the id of the logged in user. This part is identical to the profile page, there is a recordset that is filtered by the userID. Since the recordset is filtered like this any values that you bind to the page from the recordset will only display details specific to that user.

Please post back with any further questions you have about any part of this.

KW2912
10-10-2009, 08:07 AM
Thanks Eric. Yes that makes sense to make one dynamic page. The problem is that I'm a complete newbie to mysql queries and the code required to operate them etc.

OK I've been busy trying what you said Eric. Could you possibly visit my site again - try the registration and confirm that everything looks fine and secure? I would really appreciate your expert opinion in anything that's not right or needs looked at.

Many thanks for all your assistance

http://www.subzerowebsolutions.co.uk/clients/user_login_data/users_LogIn.php

Eric Mittman
10-13-2009, 05:12 PM
Things are looking pretty good to me. I was able to register, then confirm my email, then login again. Once I logged in I went to what looks like a project detail page. I think you are getting this all together, you may need to just update a couple of more things.

In your projects table in your db do you have a column for the userID? If you would like to show project info that is specific to the user then you will need to associate this info with a user by having a column hold a reference for that user, normally the user ID.

You then filter the recordset that displays the project data by the userID based on the id of the currently logged in user. Please post back with any additional questions you have about any part of this.

KW2912
10-14-2009, 05:43 PM
Thanks for taking the time to look at the site and register Eric - I'm sure you're a busy man and your time is really appreciated.

The reason your project data is blank is that I hadn't updated the database records with project data - this is something I would do for my customers once a project had been confirmed.

As I mentioned my mysql skills are incredibly basic so for the "Project" area I've taken the easy route of adding a few extra fields into the original "users" database containing the project data (I'll probably create a new table at a later date). After that I've just made a copy of the "users_Profile.php" and called it "users_Support_area.php" - that way it still has all the login checks and using the user ID info from the "users" table to pull up the relevant details - I also just changed the form fields and links to display the correct data.

I'm sure I've probably done this the hard way but it seems to be working!!!

Thanks again for all your help.

Eric Mittman
10-14-2009, 05:59 PM
One nice thing about web development and software in general is that there are usually many paths to success, if what you have is working for you then that is awesome.

Please post back with any other questions or issue you have and we will be glad to help you out.