CodeIgniter Forums
condition not checking - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: condition not checking (/thread-71338.html)



condition not checking - kvanaraj - 08-01-2018

$ech = $this->agent->platform();

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

it's not working. how to solve?


RE: condition not checking - InsiteFX - 08-02-2018

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.


RE: condition not checking - kvanaraj - 08-03-2018

(08-02-2018, 05: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


RE: condition not checking - InsiteFX - 08-03-2018

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;