• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User agent

#1
Information 
i am not able to get correct browser name using user_agent function

 i tried the following code and did not get perfect output.



Code:
$this->load->library('user_agent');
      if ($this->agent->is_browser())
      {
              $agent = $this->agent->browser().' '.$this->agent->version();
      }
      elseif ($this->agent->is_robot())
      {
              $agent = $this->agent->robot();
      }
      elseif ($this->agent->is_mobile())
      {
              $agent = $this->agent->mobile();
      }
      else
      {
              $agent = 'Unidentified User Agent';
      }
     
      echo $agent.'<bR>'.$this->input->ip_address();
      echo $this->agent->agent_string().'<br>';
      echo $this->agent->platform();


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
i also added the name name of browser in the user_agents.php in browser but that is not working please help


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
User agent - by bossmukul - 10-22-2017, 11:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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