Hi,
I've been tinkering about with some coding to password protect pages. However, I'm after something different - I want to be able to give each user their own specific area/page on the site - read only - so that updates for their eyes only can be viewed by them.
I can't seem to find anything on the web for this - all tutorials seem to be for log ins to enable the person to view a page or not. I would like a user to log in and see a page of data.
So for example, if Mr Bloggs from A Company gets a login, they will be directed to www.adomain/acompany.html; and someone from another company, say A Firm would get www.domain/afirm.html.
I hope that makes sense. What should I be looking for? Sometimes it's my lack of correct terminology which hinders my finding things on the web.
Cheers
Lorraine
Page 1 of 1
Secure pages - per user
#3
Posted 17 March 2010 - 09:00 PM
notbanksy, on 17 March 2010 - 07:58 PM, said:
Modx will do this with ease. http://modxcms.com/
Thank you. At first glance, I'm not sure where to start. Any pointers?
#4
Posted 18 March 2010 - 07:26 AM
Modx seems a bit heavy handed for this. I presume you are using a database to hold your usernames and passwords. Just put in the users 'home page' as well then redirect them to it using :
Remember, the header must be sent before any other output (even spaces) to the browser.
header("Location: $homepage"); where $homepage contains the appropriate url.Remember, the header must be sent before any other output (even spaces) to the browser.
#5
Posted 18 March 2010 - 09:25 AM
MODx is simply overkill for this. 
For users you'd usually have a kind of controller page (E.g. user.php) that would load the current users details.
However, for your problem I'd the following:
For users you'd usually have a kind of controller page (E.g. user.php) that would load the current users details.
However, for your problem I'd the following:
- Create a table with the following columns: userID, Name, PageURL
- When checking if a user is logged in fecth the PageURL from the DB too
- If the user name and password is valid, redirect them to their PageURL
- On the page URL you'd need a little more checking too. E.g. to ensure the current user matches the allowed user (or users) to whom the page belongs. If you wanted to allowed multiple people access to a page you'd need a couple of moire tables.
- ← Help with understanding error message
- Server Side (PHP, Databases, ASP.NET, etc)
- Instant Error Message Feedback on PHP Contact Form? →
Share this topic:
Page 1 of 1
Help



















