Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

includes with user agent

Featured Replies

Hi,

I want to detect ie7 and ie8 users, then include ie_header.php if the user is on that browser, or just heaer.php if its any other browser;

 

I was advised on this code, but not getting a response on the post.

 

if($_SERVER['HTTP_USER_AGENT'] == 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)')
include 'Includes/Header.php';
else {
include 'Includes/IE_Header.php';
};

 

Any help would be greatly appreciated as im having some rather dreadful compatiblity errors in ie7 and 8 with some plugins that im using.

 

Thanks in advance.

 

Craig

  • Author

thanks for the reply.

I have tried with the html but for some reason it ruins the design completely. puts everything out of place.

 

I think this is the right route, i just need to understand why its not working.

 

Thanks

To be honest I don't know why the content specifically has to be completely different. Is there major changes that you want people with <IE8 to see / not see?

 

I think modern standards and designs encourage us to have the same content regardless of the browser with different styles applied to different type of browsers.

 

But with the code I posted above you need to get the exact user agent string.. use this: http://www.enhanceie.com/ua.aspx

 

Also your if statement needs braces after the if() and before the else

  • Author

ive validated the site and it and no errors came up, it has to be different because the plugins are interfering with each other on ie 7 and 8

  • 2 weeks later...

Have you considered using Regular Expressions to match the User Agent rather than just an equality check on a string? Either that or use full device detection software.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.