browser redirect php script needed

1 replies
Does anyone have a simple script to redirect visitors based on their browser type? For example, I'd like to take FF and IE users to go one page, and Safari/Chrome/Opera users to another.

Thanks
#browser #needed #php #redirect #script
  • Profile picture of the author Voon
    Something like this?

    <?php
    $useragent = $_SERVER['HTTP_USER_AGENT'];
    if (preg_match('/Firefox/i', $useragent) || preg_match('/MSIE/i', $useragent))
    {
    header('Location: http://onepage');
    }
    else
    {
    header('Location: http://another');
    }
    ?>
    Signature

    .

    {{ DiscussionBoard.errors[1527750].message }}

Trending Topics