• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help better method

#3
@skunkbad
I am sorry for any bad explanation may have caused you not catch properly my problem.
I already have users management, so my problem not here.
Maybe this one can make more clear.

 example: in dashboard index view I have links:
PHP Code:
<a href="http://me.com/projects/index/1" title="List Project">Project</a>
<
a href="http://me.com/projects/index/2" title="List Project">Project</a>
<
a href="http://me.com/projects/index/3" title="List Project">Project</a>  

Say users open above first link which has id '1', it will direct users to second controller (projects controller).
In index function I catch this id and store it as projectid to session userdata:

projects controller:
PHP Code:
function index($projectid NULL)
{
        // set project ids to session userdata
        $ses = array('projectid' => $projectid);
        $this->session->set_userdata($ses);

        // querying get data of project
        $this->project_model->data_project($projectid);


Next, it will make me easy if need querying to database in other function.
example I have function 'list goods' in (projects controller);
PHP Code:
function list_goods()
{
        // get project id from session
        $projectid $this->session->userdata('projectid');

        // querying get list of goods related project
        $this->project_model->goods_project($projectid);


The problem came if users open different projects in multiple tabs browser:
Let say users open project which has id '1' in (first tab) and,
open project has id '3' in (second tab),
then users switch to (first tab) and refresh the page, session data projectid in first tab will changed to '3'.

I need a better method so users can enjoy open multiple projects in multiple tabs browser..
Reply


Messages In This Thread
Need help better method - by ichadhr - 07-09-2015, 07:04 PM
RE: Need help better method - by skunkbad - 07-09-2015, 10:28 PM
RE: Need help better method - by ichadhr - 07-10-2015, 08:20 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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