I want to be able to server different variations of a code based on the user. So if USer A signs in i want them to see code/pages pertaining to their preferences.
I know we can do a php/mysql to save paths. But how do i serve the code on the same page. All users have the same page index.php, home.php, profile.php but i want to be able to use the same page to serve those requests by simply show the code that is specifc to them..
Just a try...
You can store the preferences loaded from your database or what so ever, in session variables. Next step is to simply print those variables on the page. This way every user gets its own page.
Example:
This will put out:
You could also try to use Ajax, but I'm a noob in Ajax myself so I can't help you with that, but you could do some searching.
I hope it can help you!
UPDATE:
To set a session variable you can load a value from what ever your source is and store it like any other variable. Like:
Make sure you enabled the session by starting each page with:
I'll hope this is an answer to your question.
Where do you actually get the information of User a from? I suppose a database?
Not entirely sure if this is what you're after, but maybe it'll help get you on the right path...
Output: