CodeIgniter Forums

Full Version: condition not checking
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
$ech = $this->agent->platform();

if ($ech == 'Windows 8')
{
  //echo $ech;
  redirect('/home');
}
else
{
  redirect('/login');
}

it's not working. how to solve?
If you read the documentation and look at ./application/config/user_agents.php

It is missing Windows 8 / 10

You need to edit that config file and add them to the array.
(08-02-2018, 04:01 AM)InsiteFX Wrote: [ -> ]If you read the documentation and look at ./application/config/user_agents.php

It is missing Windows 8 / 10

You need to edit that config file and add them to the array.

want to block the URL (those who are opening in the Mobile app) thats why i am asking
If you are using CI 3X you will see at the top of the config file.

PHP Code:
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3'  => 'Windows 8.1',
'windows nt 6.2'  => 'Windows 8',
'windows nt 6.1'  => 'Windows 7'

So for Windows 8 your check should be windows nt 6.2 etc;