472,962 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,962 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 7274

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
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.