473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

get_browser() and browscap.ini

Hello,
today I stumbled across the function get_browser
(http://be2.php.net/manual/en/function.get-browser.php). Totally
excited, I tried it out. Hmm, didn't seem to work :-s.

So I read the page again, only a little bit more concetrated. Aha,
"browscap.ini is not bundled with PHP but you may find an up-to-date
browscap.ini file here."

So I visited thát site, but then I stumbled across "Despite my pleas to
have the link from the PHP website removed they refuse to do so. Until
their get_browser() function is fixed I do not recommend using my
browscap.ini file with PHP." And his faq
(http://www.garykeith.com/browsers/faq.asp) tells me:

<faq>
Is your browscap.ini file compatible with PHP?
It used to be, and it may once again be. But for now, due to problems in
get_browser() not my files, I'd have to say no. I am guardedly
optimistic this situation will resolve itself soon.
</faq>
Is there a way to solve this issue? I would like to convince the admin
of the server my site is running on to support get_browser, but if php
doesn't seem compatible with browscap.ini, then the probably isn't much
I can do about it... I guess?
greetings,
Mattias
Jul 17 '05 #1
6 7295

Is there a way to solve this issue? I would like to convince the admin
of the server my site is running on to support get_browser, but if php
doesn't seem compatible with browscap.ini, then the probably isn't much
I can do about it... I guess?


I doubt it.

However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to achieve?
Martin
Jul 17 '05 #2
Martin Lucas-Smith schreef:
[...]
However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to achieve?


It's not *really* necessary, but without it, the users of IE6.0 can't
select anything on http://student.ugent.be/astrid/bewoners.php (strange,
but with IE5.x it worked), just because I had the following on top of my
webpage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

So I needed code that omitted the DOCTYPE when IE was used and that's
how I stumbled across get_browser. Of course, I have to other options
that don't need the browser sniffing:

(1) I just ignore the IE users. But although I really dislike IE (not
because it's from Microsoft, but because IE doesn't evolve together with
the webstanders), I can't ignore those users :-/.

(2) I *always* omit the DOCTYPE. But then my page isn't W3C compliant.
Conclusion: "If only IE was a browser, better supporting the
webstandards..."
Mattias
Jul 17 '05 #3
Mattias Campe wrote:
Martin Lucas-Smith schreef:
[...]
However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to
achieve?


It's not *really* necessary, but without it, the users of IE6.0 can't
select anything on http://student.ugent.be/astrid/bewoners.php
(strange, but with IE5.x it worked), just because I had the following
on top of my webpage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

So I needed code that omitted the DOCTYPE when IE was used and that's
how I stumbled across get_browser. Of course, I have to other options
that don't need the browser sniffing:

(1) I just ignore the IE users. But although I really dislike IE (not
because it's from Microsoft, but because IE doesn't evolve together
with the webstanders), I can't ignore those users :-/.

(2) I *always* omit the DOCTYPE. But then my page isn't W3C compliant.


(3) Learn a bit more about the IE6 DOCTYPE switch and adapt your Javascript
or CSS (which probably causes the trouble) accordingly:
http://msdn.microsoft.com/library/en...ments.asp?fram
e=true#cssenhancements_topic2

BTW, I am not sure what you mean by 'select' in your statement above -- the
page works equally to me on IE6 and Firefox.

If it behave differently on IE5, then the problem is not in PHP, but your
HTML/CSS/Javascript.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 17 '05 #4
Mattias Campe wrote:
However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to achieve?


It's not *really* necessary, but without it, the users of IE6.0 can't
select anything on http://student.ugent.be/astrid/bewoners.php (strange,
but with IE5.x it worked), just because I had the following on top of my
webpage:


I'm not sure if browser sniffing is your best solution but if you really
must do it, if the $_SERVER['HTTP_USER_AGENT'] contains 'MSIE 6.0' and does
not contain 'Opera' then it's extremely likely to be IE 6.0

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 17 '05 #5
Berislav Lopac schreef:
Mattias Campe wrote:
Martin Lucas-Smith schreef:
[...]
However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to
achieve?
It's not *really* necessary, but without it, the users of IE6.0 can't
select anything on http://student.ugent.be/astrid/bewoners.php
(strange, but with IE5.x it worked), just because I had the following
on top of my webpage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

So I needed code that omitted the DOCTYPE when IE was used and that's
how I stumbled across get_browser. Of course, I have to other options
that don't need the browser sniffing:

(1) I just ignore the IE users. But although I really dislike IE (not
because it's from Microsoft, but because IE doesn't evolve together
with the webstanders), I can't ignore those users :-/.

(2) I *always* omit the DOCTYPE. But then my page isn't W3C compliant.


(3) Learn a bit more about the IE6 DOCTYPE switch and adapt your Javascript
or CSS (which probably causes the trouble) accordingly:
http://msdn.microsoft.com/library/en...ments.asp?fram
e=true#cssenhancements_topic2


(1) When I didn't had any Javascript on my website, I didn't had the
problem => JavaScript doesn't cause the trouble

(2) The CSS-file validates correctly
(http://jigsaw.w3.org/css-validator/v...re%2Fnieuw.css)
=> CSS doesn't cause the trouble (or it should be that the w3c validator
is wrong). I appreciate the link that you gave me, but it's too much
work to read through the msdn, mozilla, khtml and opera pages to see how
they handle their pages, that's why I (mostly) only check if the
(html/CSS)page validates correctly with the w3c and that's (in my humble
opinion) the way it should be.
BTW, I am not sure what you mean by 'select' in your statement above -- the
page works equally to me on IE6 and Firefox.
That's because I already omitted the DOCTYPE through some browser
sniffing, now I included it again, so you can see it doesn't work on
IE6: http://student.ugent.be/astrid/bewoners.php
If it behave differently on IE5, then the problem is not in PHP, but your
HTML/CSS/Javascript.


In my opinion, that's a little bit to fast for a conclusion, I think
it's a problem in IE6 ;)

Greetings,
Mattias
Jul 17 '05 #6
Chris Hope schreef:
Mattias Campe wrote:

However, I would implore you to consider why you need to do browser
sniffing. Is it *really* necessary for what you are trying to achieve?


It's not *really* necessary, but without it, the users of IE6.0 can't
select anything on http://student.ugent.be/astrid/bewoners.php (strange,
but with IE5.x it worked), just because I had the following on top of my
webpage:

I'm not sure if browser sniffing is your best solution but if you really
must do it, if the $_SERVER['HTTP_USER_AGENT'] contains 'MSIE 6.0' and does
not contain 'Opera' then it's extremely likely to be IE 6.0


That was the way I did it first, but then I stumbled across the
get_browser() function and it seemed to be a more clean solution. That's
why I asked on this newsgroup.

Mattias
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
5
by: R. Rajesh Jeba Anbiah | last post by:
Anyone knows how ASP detects frame? I couldn't find any PHP solutions yet. TIA -- | Just another PHP saint | Email: rrjanbiah-at-Y!com
7
by: windandwaves | last post by:
Dear Gurus Is it correct that you do not have to pass the PHPSESSID in the header in order to keep a session going. What are the advantages/disadvantages of having the PHPSESSID in the header ...
2
by: George Hester | last post by:
If you take a look at this page: http://www.abiglime.com/webmaster/articles/asp/121798.htm there is "n example of using this component...below" Here he sets the ServerObject but lists each...
15
by: CMM | last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My superiors have decided that it would be nice if we ensured the site worked on all the major platforms (as they see it: IE,...
2
by: Eduardo | last post by:
Hi people, I need some help. A important proccess in my application need to know if the browser avail javascript, using server-side code, but the server have not browscap.ini. Somebody may help...
6
by: Jim | last post by:
How do I check if javascript is enabled in PHP? TIA, Jim
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.