954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Force link to open in IE

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

tjgolf
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

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?

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

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

- http://plasma.nationalgeographic.com/pearlharbor/ax/map.html

.

PC.Tech
Newbie Poster
1 post since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

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.

drjohn
Posting Pro in Training
445 posts since Mar 2010
Reputation Points: 76
Solved Threads: 80
 

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)

dreamer14
Light Poster
31 posts since Sep 2008
Reputation Points: 10
Solved Threads: 1
 

Mac
Linux
FreeBSD

precisely How do you get those systems to open IE ?

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

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
   'http://security.symantec.com/sscv6/home.asp?langid=ie&venid=sym&close_parent=false'  //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

seanw83
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

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

- http://plasma.nationalgeographic.com/pearlharbor/ax/map.html

.


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!

teedoff
Posting Pro
599 posts since Jul 2010
Reputation Points: 21
Solved Threads: 60
 

@almostbob 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 'http://security.symantec.com/sscv6/home.asp?langid=ie&venid=sym&close_parent=false' //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); }
zaworko
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: