• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show content for scpecific user

#1
[eluser]ardillanet[/eluser]
Hello

I am developing an intranet and all user are registred. But I need show some content of intranet just for one specific user.


In my view I have this:

Code:
if($this->session->userdata('logged_in'))
   {
   $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
echo 'here I show some content';

But all user can see this content.

How can I do for show so for one user?

If somebody have any idea I really will happy Wink

#2
[eluser]solid9[/eluser]
wow confusing dude,

First of all why you wanted only one person can view the content?

You need to elaborate more dude so we can help you.


#3
[eluser]PhilTem[/eluser]
You need to obviously match the current user's username against the name that may only view the content. Just that simple.

Though it sounds a little like you have little to no knowledge of coding PHP or other languages in general? Please tell me that I'm wrong!

#4
[eluser]CroNiX[/eluser]
I would match their user ID, or user level, rather than their username. Most systems allow for users to be able to change their username.

#5
[eluser]ardillanet[/eluser]
I solve this. CI run like PHP ever, I'm fool Sad

I did this:

Code:
if($this->session->userdata('logged_in'))
   {

   $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
     if ($data['username']=='userX')
     {
echo 'show some content";
}



Thank you to all Wink

Regrads
Arol


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.