SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Nov 8, 2000, 22:17 #1
- Join Date
- Jun 2000
- Posts
- 165
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello,
Does anyone know if full browser compatibity can be achieved with php, or is Javascript still the preferred method?
For example, will '$remote_browser = $HTTP_USER_AGENT;' work with all browsers?
Instead of using a whole load of if statements with Javascript, can't we just apply the same method (i.e. using if sataements) in PHP?
None of the many books I have on php really discuss browser compatibility.
So do you have a view on this please?
Thanks,
Jason
-
Nov 8, 2000, 23:24 #2
- Join Date
- Sep 1999
- Posts
- 1,390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Since PHP is a server-side language rather than a client-side language, it will work on all browsers. The client needs no software: it is the server that runs PHP. While javascript is processed on the end-user's computer, PHP is totally remote.
PHP is definately worth learning.
-
Nov 8, 2000, 23:59 #3
- Join Date
- Jun 2000
- Posts
- 165
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That's great news!
There still remains a problem however.
How can I find out what output all the different browsers will give?
i.e. with:
$remote_browser = $HTTP_USER_AGENT;
I've tried downloading them so I can view the result by going to my site page, but I'm having difficulty locating all the different browser versions (the older ones especially) and also installing them along side each other.
So does anyone know where I can get examples of the output please?
e.g. Internet Explorer 5 would be:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
but what about for all the other browsers?
Thanks again,
Jason
-
Nov 9, 2000, 00:51 #4
- Join Date
- Aug 2000
- Location
- Silicon Valley
- Posts
- 2,241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could download the log file and see all the output about browser info.
Here are some that I collect in my raw log file
Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; DT)
Mozilla/3.01 (compatible; )
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; T-Online Internatinal AG)
Mozilla/4.0 (compatible; MSIE 5.01; AOL 4.0; Windows 98; Compaq)
Mozilla/4.73 [de]C-CCK-MCD DT (Win98; U)
Mozilla/4.73 [de]C-CCK-MCD DT (Win98; U)
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; QXW03342)
Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; sureseeker.com; HomePage)
Wow, a lot more, but don't have time to filter!
There are quite a few strange ones to me, anyone decode them?
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
-
Nov 9, 2000, 07:48 #5
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Its not the browser that outputs those variables, its your HTTP server that does.
So unless you change servers alot to a server that doesn't support it (I'm fairly sure all servers support http_user_agent) then it wont work.
So, yes, you will always be able to refer to it as you have listed.
Obviously what the contents of the variable are will change.
Chris
-
Nov 9, 2000, 17:33 #6
- Join Date
- Jun 2000
- Posts
- 165
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How's it going?
Thanks for your help so far.
123finder almost has the answer I'm looking for.
Surely as we are only dealing with a few browser versions (i.e. IE3, 4, & 5 --- and --- Netscape, 2,3,4) we'd only need to check for 5 or 6 condidtions (as with Javascript) - not the entire log file as 123finder suggested.
So does anyone please know what these are - I can't find out because I don't have access to the earlier browser versions.
Alternatively, does anyone know of a browser emulator so I can check for myself (if this is possible).
Thank you again......
Jason
-
Nov 9, 2000, 19:57 #7
- Join Date
- Aug 2000
- Location
- Silicon Valley
- Posts
- 2,241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What you could do is take a look at the tracking JavaScript (from hitbox, thecounter,... ), see what are their if statements, then adapt those to PHP, since PHP also gets what JavaScript could get about browser/OS info.
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
-
Nov 9, 2000, 22:01 #8
- Join Date
- Jun 2000
- Posts
- 165
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for that tip 123finder!
Bookmarks