Results 1 to 5 of 5

Thread: Redirect with meta (refresh) or anything...

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Redirect with meta (refresh) or anything...

    Don't ask me why, but I want to check what browser the user has and then redirect them to two diffrent sites. I have made some code in PHP to find out what browser they have, but I am only getting parse errrors when I try to redirect them....anyone want to help? I have tryed to use meta(refresh) and header(location) but I can't get it to work. Anyone care to help a n00b....please...


    If anyone could just show me the way I would be really greatfull....


    here is a sample code of what I am trying to do....


    PHP Code:

        <?php
            
    #Browsertype.php

            
    $match strpos($HTTP_USER_AGENT"MSIE");

            echo 
    "$HTTP_USER_AGENT";
        
            if (
    $match 0) {
                
    //redirect please...
                
    exit;
            }else {
                
    //redirect please...

                
    exit;
            }
        
    ?>

  2. #2

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    And if I am using header I am getting this error


    Warning: Cannot modify header information - headers already sent by (output started at /home/klub/public_html/bergen/epa2/index.php:6) in /home/klub/public_html/bergen/epa2/index.php on line 15

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Remove:

    Code:
    echo "$HTTP_USER_AGENT";
    And it will work fine. No output whatsoever can be sent to the browser before using the header() function.

    Plus putting that in quotes is redundant.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Thanks. I had tryed it. But the time I had tryed it I had all the header and body tags there. And I got the same result. And the extra quotes was just to try to find where the error was. I tryed everything to find out what was wrong......but now it is working and I have learned a new thing...thanks

  5. #5
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    ...

    PUT RESOLVED IN YOUR ORIGINAL POST, BY CLICKING EDIT...
    Zeegnahtuer?

Posting Permissions

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



Click Here to Expand Forum to Full Width