Jump to content

PHP Include w/If IE Condition Statement?


Alan Horvath

Recommended Posts

I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus improperly. I found a solution that works ... I have a PHP file that I place as an include on all my pages and the drop down menus, on IE, are cool.

 

But my problem, at present, is this:

I need to have that PHP Include (for IE) loaded, in place of my regular PHP Include (for all the other browsers), when some one is using the IE browser.

 

Is there a way to write an "If IE" conditional statement for a PHP Include?

 

Thanks for your help!

 

Alan

Link to comment
https://forums.phpfreaks.com/topic/178127-php-include-wif-ie-condition-statement/
Share on other sites

I found one that works.

 

This goes into "index.php" (and *nothing* else):

 

<?php

if (eregi("MSIE", $_SERVER['HTTP_USER_AGENT']))

  { $location = 'http://somesite.com/index_ie.php';

    header ("location: $location");

    exit();

  } else {

    $otherlocation = 'http://somesite.com/index_allothers.php';

    header ("location: $otherlocation");

    exit();

  }

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.