How to automatically disable document modus IE7

Posted on 2014-07-29
Last Modified: 2014-07-29

We developed websites where customers can find personal financial information. Now in some cases our customers automatically open a website in Internet Explorer in document modus IE7. It is possible that the user changes this setting by himself at his PC. But I prefer to make a server setting in order to prevent websites displaying in IE7 doc modus. Is that possible?

(I think the problem with the document modus only occurs when our clients use our website in intranet environment. I see that there is a setting 'display intranet sites in compatibility view'. So, how can we automatically disable this option at the server?)


Question by:adiemeer
  • 2
LVL 13

Accepted Solution

duncanb7 earned 500 total points
ID: 40226900
You can use browser detection to detect the user request header which is modified by users on clicking  F12 key in order to  determine what version of document mode users are trying to change, and modified  the page's user-agent  in the header information  before send or response back to user's browser.
For example only,
Users call financial.php to your server and in your finanical.php you have code something like that as follows and the re-send the page to users with or without condition similarly in Example-1 and Example-2
and with your wishing user-agent information for users that will force user to following your rule to view the your-original-finanical.php webpage.

Hope understand your question completely. If not , please point it out.

Example-1: detect IE7 document mode and re-send
$curl = curl_init();  //initital a curl call
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your default info...."
$ua= $_SERVER['HTTP_USER_AGENT'];  //get the user's user-agent
if (strpos($ua," "MSIE 7.0)>0){
//Detected IE 7  and change user-agent for IE 10 and  re-send it by curl() 
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your new info......."
curl_setopt( $curl, CURLOPT_URL,            "http://yourdomian/your-original-financial.phg  );
$htm = curl_exec($curl); //re-send the page to users 

Open in new window

Example-2, whatever users' document mode, just resend it to original page.
$curl = curl_init();  //initital a curl call
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your default info...."
culr_setopt( $curl, CURLOPT_URL,            "http://yourdomian/your-original-financial.phg  );
$htm = curl_exec($curl); //re-send the page to users 

Open in new window


Author Closing Comment

ID: 40228503
Thank you
LVL 13

Expert Comment

ID: 40228513
Thanks for your points

Have  a nice day


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After uninstalling Opera browser (for example ver. 10.63), your attempts to open a web page by clicking on a URL link may fail with an error message.  The error is "This operation has been canceled due to restrictions in effect on this computer. Ple…
Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question