• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
condition not checking

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

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

it's not working. how to solve?
Reply

#2
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(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
Reply

#4
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;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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