Post by seffe » Fri Feb 05, 2010 10:08 pm

Does anyone how I can send a visitor to another website if he/she is using Internet Explorer 6??

I have problems with my new layout.. it works great in all browsers expect IE6 therefore I want to redirect users to another site. Where should I put the code and what code is that :)?

Thanks for the help guys! And also thanks for the best cart in history!

Newbie

Posts

Joined
Fri Feb 05, 2010 9:03 pm

Post by seffe » Fri Feb 05, 2010 10:37 pm

I have found it. No problems :)

Code: Select all

<?php

$ua = $_SERVER['HTTP_USER_AGENT'];

if (strpos($ua,'MSIE') != false && strpos($ua,'Opera') === false)
{
if (strpos($ua,'Windows NT 5.2') != false)
{
if(strpos($ua,'.NET CLR') === false) return;
}
if (substr($ua,strpos($ua,'MSIE')+5,1) < 7)
{
header('Location: http://www.the-website-u-want-to-redirect-to.com);
}
}

?>

Newbie

Posts

Joined
Fri Feb 05, 2010 9:03 pm

Post by Qphoria » Fri Feb 05, 2010 10:49 pm

A simple javascript version here as well:

1. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

2. FIND:

Code: Select all

</head>


3. BEFORE, ADD:

Code: Select all

<script type="text/javascript">
function init() {
isIE6 = /msie|MSIE 6/.test(navigator.userAgent); 
if (isIE6) {
	window.location="http://www.microsoft.com/windows/internet-explorer/default.aspx";
}
}
window.onload = init; 
</script>
Reference:http://www.thefutureoftheweb.com/blog/d ... javascript

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by huhitschris » Tue Feb 09, 2010 6:18 pm

Or you could send them to: http://idroppedie6.com/

O0

PM me for custom OpenCart template design and development.


New member

Posts

Joined
Wed Aug 19, 2009 3:12 pm
Who is online

Users browsing this forum: No registered users and 20 guests