English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to create a website using PHP and MySQL that allows users to register with the site, browse infromation, and save information that they'd like to reference later. When they log in later, they should be able to access that saved information.

I'm having a heck of a time figuring out how to do this. All the PHP tutorials tell you how to display dynamically genenerated pages, but not dynamically generated pages based on who is logged in.

Any help would be greatly appreciated!

2006-10-24 03:28:07 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

All you need to do is create a reference in the user database table to that information they saved.

the database would be laid out like:
CREATE TABLE `users` (
`userId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`password` VARCHAR(45) NOT NULL,
PRIMARY KEY(`userId`)
);
CREATE TABLE `savedInfo` (
`infoId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`userId` INTEGER UNSIGNED NOT NULL,
`savedStuff1` VARCHAR(45) NOT NULL,
`savedStuff2` VARCHAR(45) NOT NULL,
PRIMARY KEY(`infoId`),
INDEX `userId`(`userId`)
);

You can then go pretty much anywhere with it, even loading completely different layouts (save the layouts as PHP classes and dynamically create the class based on a DB field - $pageClass = new $classField;)

If you need more help, feel free to bug me more.

2006-10-24 03:35:04 · answer #1 · answered by John J 6 · 0 0

For a full dynamic profiling system, you need to build ACL in your system.

2006-10-25 06:59:57 · answer #2 · answered by d@mn 2 · 0 0

fedest.com, questions and answers