Omnis Technical Note TNWE0007

Detecting browser HTML using Apache web server

for Omnis Studio

If you are using an Apache web server running under Linux you can use shtml to detect the user's type of browser and display the right Web Client plugin, either the Netscape or Internet Explorer plugin. For example, the following shtml file loads the FORMFLDS demo page and loads the appropriate plugin.

<title>OMNIS Web Client Gallery - FORMFLDS</title>
<body bgcolor="#FFFFFF">
<!--#if expr="$HTTP_USER_AGENT = /.*[Mm][Aa][Cc].*/ || $HTTP_USER_AGENT !=/.*[Mm][Ss][Ii][Ee].*/" -->
<p><embed type="application/OMNIS-RCC-plugin" name="rcc1" width="800" height="360"
OmnisServer="5000" OmnisLibrary="formflds" OmnisClass="rfForm"
WebServerUrl="" WebServerScript="/cgi-bin/nph-omniscgi">
<!--#else -->
classid="clsid:13510606-30FA-11D2-B383-444553540000" width="800" height="360">
<param name="_Version" value="65536">
<param name="_ExtentX" value="7161">
<param name="_ExtentY" value="7373">
<param name="_StockProps" value="0">
<param name="OmnisServer" value="5000">
<param name="OmnisLibrary" value="formflds">
<param name="OmnisClass" value="rfForm">
<param name="WebServerURL"
value=""> <param name="WebServerScript"
<!-- ActiveX object END--></p>

We have used this technique throughtout the new Web Component Gallery. If you want to use the above example you'll need to change some of the parameters, such as the OmnisServer, OmnisLibrary, OmnisClass, and WebServerURL parameters.