Jump to content
anshulmahipal

want a function for user

Recommended Posts

Hello guys,. I almost complete my website including member area but now problem comes....... I need a help that every user can access their content and content is posted by admin via c pannel. for example suppose I am a admin and a user called x create his account now he is able to access the page called user.php and now admin post a content on x user page which accessible by x user only after login and other user not even saw the same content even after login so help me on this please . Please provide me source code too.

Share this post


Link to post
Share on other sites

We aren't here to write your code for you. If you want content that only certain users see then you need to design your database to support that. If it is only for 1 user then you can put a user ID in the content table in the database. If content can be seen by multiple users then you need a separate table to hold user ID/content ID pairs to say which users can see which content. When a user pulls up that page then you can ask the database for the content for that user ID.

  • Like 1

Share this post


Link to post
Share on other sites

Show the code that you're working with and what problems you're having and we can help you with those. I was talking about database design above, not code.

Share this post


Link to post
Share on other sites

Think about what you are already doing. The user has logged in so now you have some session variables that tell your database queries what messages or content to load. A table for public messages has a "from" column but a table containing private messages is going to also have a "to" column. So then what does it matter if the messages are from the admin or from some other user? What matters is that the content is intended for a particular user.

  • Like 1

Share this post


Link to post
Share on other sites

sir sorry but i dont about sql quires so kindly explain me briefly. m create a user page where i can the user name. but i dont understand how i post particular content for particular user page

Edited by anshulmahipal

Share this post


Link to post
Share on other sites

Your question is too vague. I don't know what your user content is. I presumed you were loading content from a database. You say the users log-in, so you establish sessions, right? You use session variables to decide what content to show, right?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...