| | #1 |
| Rob Tierney War Room Member Join Date: 2010 Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
|
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. |
| | |
| |
| | #2 |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
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." | |
| |
| | #3 | |
| Rob Tierney War Room Member Join Date: 2010 Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
|
<?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. | |
| | ||
| |
| | #4 |
| Active Warrior War Room Member Join Date: 2011 Location: California, USA
Posts: 41
Thanks: 1
Thanked 4 Times in 4 Posts
|
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/ --- | |
| |
| | #5 |
| Rob Tierney War Room Member Join Date: 2010 Location: Chiang Mai
Posts: 1,959
Thanks: 407
Thanked 155 Times in 120 Posts
|
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> |
| | |
| |
|
| Bookmarks |
| Tags |
| browser, detect, redirect |
| |