Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 13th Apr 2011, 12:19 AM   #1
Rob Tierney
War Room Member
 
thedog's Avatar
 
Join Date: 2010
Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
Default
IE browser detect and redirect
Share on: 
fb share twitter share gplus share more share

Hi guys. I want any users, using IE, to be redirected to a certain page on my site.

I installed this plugin, PHP Browser Detection WordPress › PHP Browser Detection « WordPress Plugins

and put the following code in my head tag, in header.php


<?php if ( is_IE ) { <meta http-equiv="refresh" content="0;url=http://www.site.com/test.html" /> }; ?>

I also tried this, but no joy,

<?php if ( is_IE ) { window.location="http://www.yourdomain.com/redirectfile.html"; }; ?>




I just got an error code.

Can someone please tell me the best way to do this, thanks.

thedog is offline  
Unread 13th Apr 2011, 01:48 AM   #2
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: IE browser detect and redirect
Share on: 
fb share twitter share gplus share more share

You're not calling the function correctly. Should be:
Code:
<?php if( is_IE() ) { do stuff here // } ?>

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 13th Apr 2011, 04:37 AM   #3
Rob Tierney
War Room Member
 
thedog's Avatar
 
Join Date: 2010
Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
Default
Re: IE browser detect and redirect
Share on: 
fb share twitter share gplus share more share

Originally Posted by SteveJohnson View Post

You're not calling the function correctly. Should be:
Code:
<?php if( is_IE() ) { do stuff here // } ?>
ok, i tried this

<?php if( is_IE() ) { window.location="http://www.site.com/test.html"; // } ?>

and it didn't work...

if this is wrong, can you please paste exactly what i need to be doing, thanks.

thedog is offline  
Unread 13th Apr 2011, 06:06 PM   #4
Active Warrior
War Room Member
 
AdFocus's Avatar
 
Join Date: 2011
Location: California, USA
Posts: 41
Thanks: 1
Thanked 4 Times in 4 Posts
Default
Re: IE browser detect and redirect
Share on: 
fb share twitter share gplus share more share

your syntax is incorrect

try:

Code:
<?php if ( is_IE ) { ?>
<meta http-equiv="refresh" content="0;url=http://www.site.com/test.html" />
<?php } ?>

Earn $4.50 per 1000 Clicks to Short URLs
--- We GUARANTEE to beat AdF.ly & Linkbucks payouts FOREVER ---
--- http://adfoc.us/ ---
AdFocus is offline  
Unread 13th Apr 2011, 09:29 PM   #5
Rob Tierney
War Room Member
 
thedog's Avatar
 
Join Date: 2010
Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
Default
Re: IE browser detect and redirect
Share on: 
fb share twitter share gplus share more share

Thanks, I ended up using this script I found online, it works, but do you think it's ok?


<script>version=parseInt(navigator.appVersion);i f (navigator.appVersion.indexOf('5.')>-1){version=5};if (navigator.appVersion.indexOf('6.')>-1){version=6}; if (navigator.appVersion.indexOf('7.')>-1){version=7}; browser='OTHER'; if (navigator.appName=='Netscape'){browser='NS'+versi on;} if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE'+version;} if (navigator.appVersion.indexOf('MSIE 3')>0) {browser='MSIE3';} if(browser == 'NS5'){browser='NS6'};if (browser=='MSIE3') {window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE4') {window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE5') {window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE6') {window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE7'){window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE8'){window.location='http://www.site.com/ie-chrome-frame/'}if (browser=='MSIE9'){window.location='http://www.site.com/new/'}if (browser=='NS3') </script>

thedog is offline  
Closed Thread


Bookmarks

Tags
browser, detect, redirect


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:18 AM.