| Back to top |
Hello,
Can some one tell me what I am doing wrong here; <? // Browser Based Redirection // If browser is Internet Explorer if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) {Header ("Location: [link]);} // If browser is Mozilla elseif ($name = strstr ($HTTP_USER_AGENT, "Mozilla")) {Header ("Location: [link]);} // If browser is anything else else { Header ("Location: [link]);} ?> I want to set up a multi-browser redirection script based on browsers user agent. And if anyone also knows how I can achieve the same result using a htaccess file on apache 2.0 server I hope someone can help. buzz |
|||||
|
techAdmin
Back to top
Status: Site Admin Joined: 26 Sep 2003 Posts: 1716 Location: East Coast, West Coast? I know it's one of them. |
:: Code :: $name = strstr ($HTTP_USER_AGENT, "MSIE"))Make sure you read about how to use php before you try to do it, if you don't know the syntax it's essentially impossible to do programming in any language, so it pays to either buy a basic book on it (o'reilly books are great) or to read some good basic tutorials online, making sure you understand each and every character and syntax operator in the samples. = is an assignment operator, and == and === are equality operators. Also make sure to check out our various php browser and language detection scripts for more examples. I suggest the simple php browser detection and the language detection to see working samples. |
|||||
|
All times are GMT - 8 Hours
|
||||||
Contact Us
Hosting: Pair Networks: 0.044
Forum Software © 2001–2009 phpBB
techForum Style © 2003–2009 techpatterns.com
info
Hosting: Pair Networks: 0.044
Forum Software © 2001–2009 phpBB
techForum Style © 2003–2009 techpatterns.com
info