|
-
Jul 5th, 2003, 03:18 PM
#1
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;
}
?>
-
Jul 5th, 2003, 03:37 PM
#2
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
-
Jul 5th, 2003, 10:07 PM
#3
Stuck in the 80s
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.
-
Jul 6th, 2003, 04:40 AM
#4
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
-
Sep 4th, 2003, 03:12 PM
#5
...
PUT RESOLVED IN YOUR ORIGINAL POST, BY CLICKING EDIT...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|