PHP Access, Rights in Catalogs

They have: 3 posts

Joined: Jul 2010

hi there

i m new in php i have a project in which there is a requirement of catalogs download but these catalogs based on right, for example we have 20 catalogs of laptops,HP, Dell, Acer, and we want that user can only see and download that catalogs which we have assigned to that user, let suppose catalogs of only HP.

so any 1 have knowledge to solve this problem guide me.

They have: 3 posts

Joined: Aug 2010

You need some form of mapping users to catalogs. How to do this exactly depends on your current environment. Are the users stored in a database? If they are, you would create a new table for catalogs, something like:

catalogs
---------
catalog_id
catalog_name
catalog_filepath

..add any other fields you need to keep track of your catalogs. Then to assign catalogs to users, you would make another table, like:

catalogs_user
---------------
catalogs_user_id
user_id
catalog_id

..in which every record defines 1 access. When a user logs in, you can select from catalogs_user and join the catalogs table, giving you a list of exactly the catalogs that a user has access to. If this isn't making any sense to you, check out a few tutorials on MySQL joins.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.