Hi, I'm looking for some code to enable me to force a link in Sea Monkey to open in IE.

Dani AI

Generated

Short answer: you cannot force SeaMonkey (or any browser) to launch another browser. The OS and the user’s default settings decide that, as noted. And is right that IE simply does not exist on macOS/Linux. Also, the PHP snippet shared would only try to start IE on the server, not on a visitor’s machine; if you saw the PHP code in the browser, that means the server was not executing PHP for that file.

If the goal is to view a legacy, IE-only app, the realistic user-friendly path on Windows is Internet Explorer mode in Microsoft Edge. Users (or IT) can enable it, then add the site so it automatically opens in IE mode: Edge > Settings > Default browser > Allow sites to be reloaded in IE mode, then add the URL to the IE mode list. Organizations should use an Enterprise Mode Site List so only designated URLs open in IE mode. See Microsoft’s guidance for details: Configure IE mode in Microsoft Edge.

As a stopgap, you can detect that the page is not running in IE (or IE mode) and show a clear prompt, rather than trying to launch another browser:

<script>
  // IE/IE mode exposes document.documentMode
  if (!document.documentMode) {
    const banner = document.createElement('div');
    banner.style.cssText = 'background:#fff3cd;color:#664d03;padding:10px;margin:0 0 1rem 0;border:1px solid #ffe69c;';
    banner.textContent = 'This tool requires Internet Explorer. On Windows, open this site in Microsoft Edge using IE mode.';
    document.body.prepend(banner);
  }
</script>

One more note on the example raised by : many old IE-only pages depended on plugins like Flash. Flash has been removed from most supported Windows builds, so even opening those pages in IE/IE mode may not work today. See Microsoft’s update removing Flash: KB4577586.

Recommended Answers

All 8 Replies

Links on the web can't control what application they launch with, your OS and browser determines that. Why would you want to browse the web from one browser and launch the links in another?

... Because the site is rendered properly only by IE. Example:

-

.

What a dreadful page - no doctype for a start, so it is designed in quirks mode! then it refers to IE5 and Netscape 4.5, and Flash 5 !!!
That page is an antique from a previous century - actually it says 2001, which makes it even worse, as css had been around for about five years by then, yet it uses tables for layout and in-line styles.

so just open IE and view it.

not possible to force a specific type of browser to open with. but u can prompt them to open with ie if opened with other browsers. (Eg Warning messages)

Mac
Linux
FreeBSD

precisely How do you get those systems to open IE ?

you could use :

$id = $HTTP_GET_VARS['id'];
$sites = array(
   'http://housecall.trendmicro.com/housecall/start_corp.asp',  //TrendMicro Housecall
   'http://www.pandasoftware.com/products/activescan/com/activescan_principal.htm',  //Panda ActiveScan
   ''  //Symantec Virus Scan & Security Check
);
$redirectPage = $sites[$id];

//Determine if IE or not
$_SERVER=$HTTP_SERVER_VARS;
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){
   if(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') ){
     $browser = 0;
   }
   else{
     $browser = 1;
   }
}
else{
   $browser = 0;
}

//Display the appropriate result
if($browser==0){  //not IE

echo exec('"C:\Program Files\Internet Explorer\iexplore.exe" '.$redirectPage.'');

}
else{  //IE
   header('location:'.$redirectPage);
}

save that in a file call ie_redir.php (or something) then add this HTML:

<A HREF="../IEtest/ie_redir.php?id=1" target="_blank">open in IE</A><br/>

ive amended some code i already had to make this work. hope it helps

... Because the site is rendered properly only by IE. Example:

-

.

lol thats not the browser's fault. As mentioned, you should fix the coding errors, including adding a valid and complete doctype! Clean code and a valid doctype is the BEST way to ensure ALL browsers render properly. You can view the errors here.


AGGGGGGG 3 year old thread! lol I didn't look!

your code is not working :/ the php is not work :// the code could redirect and open in Internet Explorer but it shows the code instead
I get this code:

$id = $HTTP_GET_VARS['id']; $sites = array( 'http://housecall.trendmicro.com/housecall/start_corp.asp', //TrendMicro Housecall 'http://www.pandasoftware.com/products/activescan/com/activescan_principal.htm', //Panda ActiveScan '' //Symantec Virus Scan & Security Check ); $redirectPage = $sites[$id]; //Determine if IE or not $_SERVER=$HTTP_SERVER_VARS; if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ if(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') ){ $browser = 0; } else{ $browser = 1; } } else{ $browser = 0; } //Display the appropriate result if($browser==0){ //not IE echo exec('"C:\Program Files\Internet Explorer\iexplore.exe" '.$redirectPage.''); } else{ //IE header('location:'.$redirectPage); }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.