Re: Layout based on user_agent?
"Paul E. Ross" <[email protected]> Wed, 24 Mar 2004 07:49:01 -0600
| Newsgroups | gmane.comp.apache.mod-layout |
|---|---|
| Message-ID | <[email protected]> |
Carlos Eduardo Vianna - SouthTech wrote:
> Hello!
>
> I'd like to display a differente footer for users running IE or Netscape/other browsers. Is it possible?
> I searched deep thru the list archives, and found posts asking for this, but no answers.
>
> Any help is really welcome.
>
> Thank you very much, and congratulations for the great work. I use mod_layour for quite a while now.
>
> Carlos Eduardo Vianna
> SouthTech TI
>
I have a lot of variations in my headers and footers depending on what
browser is being used, what IP address the user is coming from, what
virtual website is being accessed, etc. The differentiation is handled
within the header and footer files by php code.
$I = ereg ("MSIE", $HTTP_USER_AGENT); /* Internet Explorer */
$K = ereg ("Konqueror", $HTTP_USER_AGENT); /* Konqueror */
$M = ereg ("Mozilla/5", $HTTP_USER_AGENT); /* Mozilla */
$N = ereg ("Mozilla/4", $HTTP_USER_AGENT); /* Netscape */
So, Apache's httpd.conf only references one header or footer file, but
the display is different depending on who is looking at the web pages
and how they're doing it.
--
Paul Ross
Senior Software Engineer
Raytheon Technical Services Company LLC
281.280.2997
281.280.4138 fax
713.736.9581 pager
[email protected]
http://www.opengov.us