Sign in to follow this  
bush

Redirecionamento

Recommended Posts

Galera boa noite !!!

Seguinte to prescisando da ajuda de você..

Bom eu presciso montar uma pagina que redireciona o usuario pra outra pagina conforme o navegador.

alguém sabe me dizer como eu pego o navegador do usuario ?

Share this post


Link to post
Share on other sites

Usa javascript...

Movendo...

PHP » Ajax, JavaScript, XML, DOM

Share this post


Link to post
Share on other sites

Você pode detectar o navegador usando navigator.userAgent

dá uma olhada no script abaixo:

<script>
        
    if (navigator.userAgent.indexOf("Firefox")!=-1)
    
         location.href="http://br.mozdev.org/firefox/";

                if (navigator.userAgent.indexOf("MSIE")!=-1)

    if (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") { 

           location.href="http://www.microsoft.com/brasil/windows/products/winfamily/ie/default.mspx";
             
        } 
        
            else {

                    location.href="http://www.microsoft.com/downloads/details.aspx?displaylang=pt-br&FamilyID=1e1550cb-5e5d-48f5-b02b-20b602228de6";

            }
</script>

Share this post


Link to post
Share on other sites
Guest ScriptMan

também pode fazer isso com navigator.appName !

por exemplo:

&lt;script>

if (navigator.appName="Microsoft Internet Explorer"){

window.location.href="index-ie.htm";

}

else {window.location.href="index-nav.htm";}

</script>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this