icon
icon
download

Detects IE6 with PHP, offers upgrade link.

A very easy to use and graceful way to alert your end users that they need to upgrade their web browser. Folks are greeted with an alert and a direct link to upgrade IE6 while still being able to view your website. See example.

Download the file and feel free to use it.

CLICK TO SEE DIRECTIONS

Requirements: Web Server running PHP 4,5
close

1. Download the file and extract the zip.
2. Look for the file named helper.html (to help copy code). The file named detect.php is a working file. Simply look at the sections to copy and paste into your documents.

*note the code below is for example use.. download the file and use that code.

Step One
Find the PHP code below and copy it to the very top of your document
<?php

//**************************************//
//										//
//	Graceful IE6 Detect Advise w/jQuery	//
//		by: Joe Watkins					//
//		http://www.thatgrafix.com		//
//										//
//**************************************//

// IE6 string from user_agent
$ie6 = "MSIE 6.0";

// detect browser
$browser = $_SERVER['HTTP_USER_AGENT'];

// yank the version from the string
$browser = substr("$browser", 25, 8);

// html for error
$error = "
Alert: It appears that you are using an out dated web browser Internet Explorer 6. While you may still visit this website we encourage you to upgrade your web browser so you can enjoy all the rich features this website offers as well as other websites. Follow this link to Upgrade your Internet Explorer
"; // if IE6 set the $alert if($browser == $ie6){ $alert = TRUE; } ?>

Step Two
Copy the below code into your document head.


	

		
Step Three
Copy the below code into the body of the document where you want the error to show up. Right below the body tag is best.
<!-- IE6 Detect Advise Notice -->
	<?php if($alert){ echo $error; } ?>
<!-- // end IE6 Detect Advise Notice -->