Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    Checking which browser someone is using

    Is there a way to check which kind of browser a viewer is using and redirect them depending on which it is?

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    But what are you using it for? If you're maintaining two different sites...*winces* bad idea.

  • #4
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Quote Originally Posted by CyanLight View Post
    But what are you using it for? If you're maintaining two different sites...*winces* bad idea.
    You can block IE
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #5
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    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.

  • #6
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Quote Originally Posted by masterofollies View Post
    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
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #7
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    But which kind of code am I looking for?

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

  • #8
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    What is the reasoning for wanting to implement 'browser sniffing'?

    Are you implementing PHP at the moment? Use the HTTP_USER_AGENT can provide some help in detecting the browser.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by jeremywilken View Post
    What is the reasoning for wanting to implement 'browser sniffing'?

    Are you implementing PHP at the moment? Use the HTTP_USER_AGENT 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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    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.

  • #11
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Most probably the issue is with your html/javascript and not with IE. Can we have a link?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #12
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    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.

  • #13
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Quote Originally Posted by abduraooft View Post
    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

  • #14
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.

    Css buttons don't work in IE

    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.
    Last edited by _Aerospace_Eng_; 10-31-2008 at 08:55 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #15
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    So you mean get rid of javascript and use solely css?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •