Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Access, Rights in catalogs
Old 07-25-2010, 05:04 PM PHP Access, Rights in catalogs
Average Talker

Posts: 19
Name: Waqas Tasneem
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
gurusofit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-25-2010, 08:50 PM Re: PHP Access, Rights in catalogs
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
You can have a table in your database that stores the catalogs and another table that stores the users. Create a third table that stores privileges. You can design that table like this:

Code:
id | catalog_id | user_id
---------------------------
1  | 56            | 3
2  | 93            | 26
etc...

Then on the catalog page, before loading the catalog do a query to the database to grab the ids of all allowed users, loop through the results and check to see if the present user's id is among the ones allowed. I assume you would have the user id saved as either a session or a cookie when the user initially logged in.
__________________

Please login or register to view this content. Registration is FREE
Marik is offline
Reply With Quote
View Public Profile
 
Old 07-26-2010, 06:36 AM Re: PHP Access, Rights in catalogs
Average Talker

Posts: 19
Name: Waqas Tasneem
Trades: 0
Ok thanks alot bro let me do this
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
gurusofit is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Access, Rights in catalogs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23061 seconds with 12 queries