Results 1 to 5 of 5

Thread: php code :p

  1. #1
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default php code :p

    here i am again right

    i need a code if someone is using firefox it redirects to another page or if someone is using internet explorer/any other browser it redirects to a diff page

  2. #2
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    I am also looking for something like this.

  3. #3
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    use if else statements i believe also use the search feature someone else asked for this before and mentor posted the answer.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  4. #4
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    knocked up this in 5 mins:
    Should work

    PHP Code:
    <?php
    function browser($agent) {
        
    $useragent $_SERVER['HTTP_USER_AGENT'];
        
    $notAgent strpos($useragent,$agent) === false;
        return !
    $notAgent;
    }
    if(
    browser('MSIE')){
        
    header("Location: ie.php"); //Change ie.php to the page u want
    }
    if(
    browser('Firefox')){
        
    header("Location: firefox.php"); //Change firefox.php to the page u want
    }
    header("Location: other.php"); //If not IE or not Firefox go here

    ?>

  5. #5
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Eric30 View Post
    knocked up this in 5 mins:
    Should work

    PHP Code:
    <?php
    function browser($agent) {
        
    $useragent $_SERVER['HTTP_USER_AGENT'];
        
    $notAgent strpos($useragent,$agent) === false;
        return !
    $notAgent;
    }
    if(
    browser('MSIE')){
        
    header("Location: ie.php"); //Change ie.php to the page u want
    }
    if(
    browser('Firefox')){
        
    header("Location: firefox.php"); //Change firefox.php to the page u want
    }
    header("Location: other.php"); //If not IE or not Firefox go here

    ?>
    why thhank yew

    +rep if i can

Posting Permissions

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