Detecting a Visitor Browser
To detect the visitor browser we need to setup something. So Check that the file C:\xampp\php\browscap.ini OR C:\xampp\php\browscap\ browscap.ini is exists or not. If you found the file browscap.ini then open php.ini file and find [browscap] in the php.ini file.
Now check that the code written below is exist or not.
browscap = "C:\xampp\php\browscap\browscap.ini"
If written then keep as it is and if no then write it and save php.ini file and RESTART YOUR XAMPP CONTROL PANEL.
Create one php file and write the code as specify below
Question arise why we are doing this program. So some time we want to display a message to user that firefox is better than internet explorer, or crome is better than internet explorer. To do that we use get_browser() function.
Using “[browser] => “ we can get our browser name.
Run your page in several other browser like Firefox, chrome or IE





No comments:
Post a Comment