custom user profile

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madhuri
Forum Newbie
Posts: 4
Joined: Wed Aug 02, 2006 11:27 am

custom user profile

Post by madhuri »

Hello All,

I am very new to php and also to this forum.I would like to add some php code that would do the following for the database that I have:

I have a server which has shared folders on it.Each user has write permission to only one folder and has read permission to all the other folders.I have MySQL database running on the server.I have an application that uses MySQL as a back-end and uses php scripting.Each user has a profile in the database too.(They have same userids as they have for the shared folders in windows).

What I would like to accomplish is that once the user logs in to the database, depending on the user's profile, I need one of the fields in the .php page to be different for each user.Is that possible?

For example, say - I have a path C:\Documents and Settings\....\user1 for user1 ; I would like it to display C:\Documents and Settings\....\...\user2 for user2.


Any help/info is appreciated.
Thanks,
Regards,
Madhuri
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This is as easily done as pulling information from the database. But is it enforceable?
madhuri
Forum Newbie
Posts: 4
Joined: Wed Aug 02, 2006 11:27 am

Post by madhuri »

I am sorry i did not really understand when you said "enforceable"?!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If I am user232, and I login and the links returned from the db show './user232', what is to stop me from entering the URL './user165'?
madhuri
Forum Newbie
Posts: 4
Joined: Wed Aug 02, 2006 11:27 am

Post by madhuri »

Actually nothing.The user is free to enter his own path.


To explain things better - all the users are now defaulted to a folder that is "one level up" and to perform any operation they need to append their home folder name which is indeed a big name and they might not remember.Rather, if each user is defaulted to his home folder it is easier for them.

Does this info help?

Thank you,
Madhuri.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Yep. Just a simple select query to pull the users folder path from their profile. I would suggest you set up a user login system, then within the table data for the user, add a field for user_path and use that to do what you want.
madhuri
Forum Newbie
Posts: 4
Joined: Wed Aug 02, 2006 11:27 am

Post by madhuri »

Thank you very much.......that really helps.....

Now, I already have a user log in system so....what I am trying to do is save the username in a variable and would like to write an "if statement" and compare each of the username and assign the default path.....according to that .Am I in the right lines?
Post Reply