CodeIgniter Forums

Full Version: Session errors in different Browser
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]rochellecanale[/eluser]
Hello guys I have a big problem and i really need your help. My problem is whenever i opened my page to other browser it displays database errors and session error. For example when i go to my profile page, it list down all the entire member and when i go to the other page it unset the sessions that's why i always got an error in database. I'm using a firefox and it runs smoothly and it can run also in opera. But when i opened it in Chrome and IE it will display the errors. So what should i do guys? Please help me. I'm not a good programmer but I'm willing to learn from you guys. That's all thanks and Godbless.

El Forum

[eluser]Beginers[/eluser]
what is the error message?

El Forum

[eluser]rochellecanale[/eluser]
Actually it displays no error. My actual error is it doesn't load the sessions. The page unset the sessions after navigating to other pages.

El Forum

[eluser]solid9[/eluser]
So the problem is in the Authentication System?
What is the name of your authentication library?
Are you the one who wrote the library?
Or you got it from somewhere else?

El Forum

[eluser]rochellecanale[/eluser]
Actually it is not in the authentication library. I think my code messed up with code that i created. Because it is a combination of HTML5 and HTML4 + PHP. I don't know where to find the actual error. I don't have my own library. It is the default libraries in CodeIgniter.

El Forum

[eluser]solid9[/eluser]
better start posting your codes rochelle.
post the controller and the page you think has a bug.
So people here can see the problem, and therefore they can help you.

El Forum

[eluser]rochellecanale[/eluser]
My view named viewmember.php

Code:
<?php
                    
                    $username = $this->session->userdata('username');
                    
                    $this->db->select('filename');
                    $query = $this->db->get_where('upload',array('username'=>$username));
                    
                    if($query->num_rows() == 0){
                        $path = "default_profile.jpg";
                    }else{
                        $row = $query->row();
                        $path = $row->filename;
                    }
                  

              ?>
              <?php
                foreach($user->result_array() as $row){
                    
     echo "<font size='2px'>Username</font><br />";
     echo "&lt;input type='text' placeholder='{$row['username']}' size='30' name='username' READONLY value='{$row['username']}' /&gt;&lt;br />";
    
     echo "<font size='2px'>Email Address</font><br />";
     echo "&lt;input type='text' placeholder='{$row['email']}' size='30' name='email' READONLY value='{$row['email']}' /&gt;&lt;br />";
    
     echo "<font size='2px'>Last Name</font><br />";
     echo "&lt;input type='text' placeholder='{$row['lastname']}' size='30' name='lastname' READONLY value='{$row['lastname']}' /&gt;&lt;br />";
    
     echo "<font size='2px'>First Name</font><br />";
     echo "&lt;input type='text' placeholder='{$row['firstname']}' size='30' name='firstname' READONLY value='{$row['firstname']}'/ &gt;&lt;br />";
    
     echo "<font size='2px'>Middle Name</font><br />";
     echo "&lt;input type='text' placeholder='{$row['middlename']}' size='30' name='middlename' READONLY value='{$row['middlename']}' /&gt;&lt;br />";
    
     echo "<font size='2px'>Gender</font><br />";
     echo "&lt;input type='text' placeholder='{$row['gender']}' size='30' name='gender' READONLY value='{$row['gender']}' /&gt;&lt;br />";
    
     echo "<font size='2px'>Mobile Number</font><br />";
     echo "&lt;input type='text' placeholder='{$row['mobile_number']}' size='30' name='mobile_number' READONLY value='{$row['mobile_number']}' /&gt;&lt;br />";
                    
                    echo "<font size='2px'>Birthday</font><br />";
     echo "&lt;input type='text' placeholder='{$row['birthday']}' size='30' name='birthday' READONLY value='{$row['birthday']}' /&gt;&lt;br />";
                    
                    echo "<font size='2px'>Address</font><br />";
     echo "&lt;textarea cols='27' rows='5' READONLY&gt;{$row['address']}&lt;/textarea&gt;&lt;br />";
                    
                    echo "<font size='2px'>TIN Number</font><br />";
     echo "&lt;input type='text' placeholder='{$row['tin']}' size='30' name='tin' READONLY value='{$row['tin']}'/&gt;&lt;br />";
    
    
     echo "<font size='2px'>Membership</font><br />";
     echo "&lt;input type='text' placeholder='{$row['account_type']}' size='30' name='membership_type' READONLY value='{$row['account_type']}'/&gt;&lt;br />";
    
     echo "<font size='2px'>Account Created</font><br />";
     echo "&lt;input type='text' placeholder='{$row['account_created']}' size='30' name='account_created' READONLY value='{$row['account_created']}'/&gt;&lt;br />";
                    
                    echo "<font size='2px'>Upline ID</font><br />";
     echo "&lt;input type='text' placeholder='{$row['upline']}' size='30' name='account_created' READONLY value='{$row['upline']}' /&gt;&lt;br />";
                }
              ?&gt;
        <br />
       </div>      
      &lt;!-- B.2 MAIN NAVIGATION --&gt;
      <div class="main-navigation">

        &lt;!-- Navigation Level 3 --&gt;
        <div class="round-border-topleft"></div>
        <h1 class="first">Primary Photo</h1>

        &lt;!-- Navigation with grid style --&gt;
        <dl class="nav3-grid">
            <br />
          <div>
            <img src="&lt;?php echo base_url('uploads/'.$path); ?&gt;" height="170" width="170" />
          </div>
          <br />

My Controller names user_controller.php
Code:
public function viewMember(){
            $data['user'] = $this->user_model->getUserWhere();
            $this->load->view('sites/viewmember',$data);
            $this->load->view('templates/footer');
        }

My model named user_model.php

Code:
public function getUserWhere(){
            $username = $this->session->userdata('username');
            $query = $this->db->get_where('member',array('username'=>$username));
            return $query;
  }