Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] detecting the user browser
#3

[eluser]xeroblast[/eluser]
i finally solved this problem. the problem was my implementation of the code.

Code:
$this->session->set_userdata('browser','< script >document . write (navigator.appName);</ script >');

is not the proper way to compare string coz the session reads the whole string as the script. that is why it has 51 characters. so i change the implementation to a different style.

Code:
function index() {
  echo '< script >window . location = "'.site_url('controller_name/browser').'/"+navigator.appName;</ script >';
}

function browser($browser) {
  if ($this->session->userdata('browser')) {
    $this->session->set_userdata('browser',$browser);
  }
  redirect('controller_name/function_name');
}


Messages In This Thread
[SOLVED] detecting the user browser - by El Forum - 02-19-2010, 11:52 PM
[SOLVED] detecting the user browser - by El Forum - 02-20-2010, 12:48 AM
[SOLVED] detecting the user browser - by El Forum - 02-20-2010, 01:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB