View Full Version : Need Script
additional
16-03-2007, 10:55 AM
:rolleyes: I've looked on google but have found nothing yet.
I need a javascript which checks if you are using IE, and if so displays a large box saying "You are using IE and our site is not compaitable etc".
Anybody know how to get this? I've seen it on Tropicalhabbo.com before.
Thanks.
Edited by Lµke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).
Colin-Roberts
16-03-2007, 11:21 AM
not exactly what you wanted but ye
if($browser == 'ie') {
Header("Location: http://the.server.com/ie.html");
} else {
Header("Location: http://the.server.com/default.html");
}
additional
16-03-2007, 12:17 PM
not exactly what you wanted but ye
if($browser == 'ie') {
Header("Location: http://the.server.com/ie.html");
} else {
Header("Location: http://the.server.com/default.html");
}
What is this ment to do?
Colin-Roberts
16-03-2007, 12:46 PM
if the browser is internet explorer it leads to a page (have the page say its Sorry but our site doesnt work with ie or w.e) and any other browser redirects to the normal site
Hitman
16-03-2007, 12:47 PM
What is this ment to do?
If you're in IE it redirects you to a page (in this case you could have saying "get ie" but if not, it redirects to the site.
Beaten by the guy above :p
QuickScriptz
16-03-2007, 01:37 PM
No results on google eh? Got this, it was link #3.....
http://www.echoecho.com/toolbrowserredirect.htm
additional
16-03-2007, 01:44 PM
No results on google eh? Got this, it was link #3.....
http://www.echoecho.com/toolbrowserredirect.htm
What did you search?
I am not wanting a redirect script, I am wanting a script which shows a footer saying "such and such" if they are using IE.
QuickScriptz
16-03-2007, 01:45 PM
What did you search?
redirect by browser type
additional
17-03-2007, 04:24 PM
I still need this. I've seen it before on Tropicalhabbo.com. It displays a footer if your not using firefox.
Invent
17-03-2007, 04:33 PM
Did this in 10 secs in PHP.
Not done very well, but does the job.
<?php
$browser = $_SERVER['HTTP_USER_AGENT'];
if(preg_match("/MSIE/i", $browser)) {
echo("<script language=\"Javascript\">
alert (\"Sorry, our site is not compatible with Microsoft Internet Explorer!\")
</script>");
}
?>
QuickScriptz
17-03-2007, 04:33 PM
For your original request, the IE thing the code is below, it's in javascript:
<script>
version=parseInt(navigator.appVersion);
if (navigator.appVersion.indexOf('5.')>-1){version=5};
if (navigator.appVersion.indexOf('6.')>-1){version=6};
if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE'+version;}
if (navigator.appVersion.indexOf('MSIE 3')>0) {browser='MSIE3';}
if (browser=='MSIE3') {docment.write(Site Best Viewed In FF)}
if (browser=='MSIE4') {document.write(Site Best Viewed In FF)}
if (browser=='MSIE5') {document.write(Site Best Viewed In FF)}
if (browser=='MSIE6') {document.write(Site Best Viewed In FF)}
if (browser=='MSIE7') {document.write(Site Best Viewed In FF)}
<script>
Pretty straight forward.... if their browser is any version of MSIE then it will display "Site Best Viewed In FF" - hope this helps! :)
EDIT: Invent must have posted while I was writing... sorry?
additional
18-03-2007, 09:19 AM
Did this in 10 secs in PHP.
Not done very well, but does the job.
<?php
$browser = $_SERVER['HTTP_USER_AGENT'];
if(preg_match("/MSIE/i", $browser)) {
echo("<script language=\"Javascript\">
alert (\"Sorry, our site is not compatible with Microsoft Internet Explorer!\")
</script>");
}
?>
Thanks this is sorta what I need, but I was more wanting it to be in a footer so it stays there until they switch to firefox.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.