...

View Full Version : Checking which browser someone is using



masterofollies
10-31-2008, 01:21 AM
Is there a way to check which kind of browser a viewer is using and redirect them depending on which it is?

twodayslate
10-31-2008, 02:07 AM
http://techpatterns.com/downloads/php-browser-detection-basic.php

http://www.google.com/search?hl=en&q=browser+check+php&btnG=Google+Search&aq=3&oq=browser+chec

Apostropartheid
10-31-2008, 02:36 AM
But what are you using it for? If you're maintaining two different sites...*winces* bad idea.

twodayslate
10-31-2008, 02:42 AM
But what are you using it for? If you're maintaining two different sites...*winces* bad idea.
You can block IE (http://twodayslate.wordpress.com/2007/09/09/blockredirect-ie6-users/) ;)

masterofollies
10-31-2008, 03:34 AM
Well right now I am building an FF site and the same thing, but different coding for IE. So the user clicks on which browser they have and it goes to that site. I want to bypass that.

twodayslate
10-31-2008, 03:57 AM
Well right now I am building an FF site and the same thing, but different coding for IE. So the user clicks on which browser they have and it goes to that site. I want to bypass that.
just use conditional comments

masterofollies
10-31-2008, 02:22 PM
But which kind of code am I looking for?

if (_______ == ____)
{
header(firefox_index.php);
}
else {
header(ie_index.php);
{

gnomeontherun
10-31-2008, 03:15 PM
What is the reasoning for wanting to implement 'browser sniffing'?

Are you implementing PHP at the moment? Use the HTTP_USER_AGENT (http://de2.php.net/manual/en/reserved.variables.server.php) can provide some help in detecting the browser.

_Aerospace_Eng_
10-31-2008, 03:28 PM
What is the reasoning for wanting to implement 'browser sniffing'?

Are you implementing PHP at the moment? Use the HTTP_USER_AGENT (http://de2.php.net/manual/en/reserved.variables.server.php) can provide some help in detecting the browser.

He already said he is using different code for each browser even though he shouldn't be. I'm assuming he tried CSS but couldn't get the HTML to look the same in other browsers so he decided to use different html for each browser in turn making it harder to update the layout and content.

Use the same code for all browsers and tweak/hack it to work in IE. If you actually did a search for conditional comments you would understand what we've been telling you.

masterofollies
10-31-2008, 05:13 PM
Well I am sorry that I am not an expert on these things. IE hates the javascript templates I have, and it also doesn't support input buttons. I wanted the site looking all flashy and have a cool design, but since half the people viewing will have IE I need a less flashy and compatible site for it.

abduraooft
10-31-2008, 05:17 PM
Most probably the issue is with your html/javascript and not with IE. Can we have a link?

VIPStephan
10-31-2008, 07:26 PM
Also, basic rule of web design: people aren’t searching for cool and flashy websites, they are searching for information. A solid but well supporting design that basically just helps to get the meassage across is a lot more useful than some flashy stuff that has to be hacked extensively so everybody might see it if s/he has the correct browser settings (but only if that’s the case).

But as said: almost everything is more or less possible in IE 6 as well if your basic code is clean and correct. Serving an alternative version of the website is just scratching at the surface of the issue but not solving it. If you showed us what you problem is we might be able to help you.

masterofollies
10-31-2008, 08:47 PM
Most probably the issue is with your html/javascript and not with IE. Can we have a link?

http://www.rodgame.org/downloads/bruce/index.php

_Aerospace_Eng_
10-31-2008, 08:52 PM
This is why you should always follow up on your old threads. This is a thread you started a while back. I gave you a solution but it looks like you never saw it and now we are here in this thread.

http://www.codingforums.com/showthread.php?t=149962

Another issue I'm seeing is you have a doctype in the middle of your page where it shouldn't be AND you have out style elements in the middle of your page where they shouldn't be. Validate your code before you say something doesn't work in so and so browser. And also the solution posted in the thread above works in IE AND Firefox.

masterofollies
10-31-2008, 10:26 PM
So you mean get rid of javascript and use solely css?

twodayslate
10-31-2008, 10:33 PM
Basically just code correctly and you shouldn't have many browser issues that can't be fixed with condition comments with CSS

_Aerospace_Eng_
10-31-2008, 10:38 PM
You don't need to use javascript for those buttons as I've showed you that you can use CSS/HTML that is cross browser compatible.

masterofollies
11-01-2008, 01:03 AM
Basically just code correctly and you shouldn't have many browser issues that can't be fixed with condition comments with CSS

Well I am trying to learn the correct way. It's going to take awhile for me to learn, since I have no idea what does and doesn't work in which browsers.

twodayslate
11-01-2008, 01:13 AM
Well I am trying to learn the correct way. It's going to take awhile for me to learn, since I have no idea what does and doesn't work in which browsers.web standards are here for a reason. http://www.w3.org/


If your page validates it should meet these standards. http://validator.w3.org/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum