caislander
11-27-2002, 03:39 AM
Hey guys I am feeling pretty darn challenged :( I need to add a browser check to my forum main page so I can serve a watered down version of our header to viewers using NS 4.xx, so I have this function
<?php
function doriteheader() {
// serve correct header by browser
global $HTTP_USER_AGENT;
if (eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
return "$footer";
} else { // other browsers
return $header;
}
}
?>
I tried placing this in the template, but that didn?t work so I am (don?t laugh too hard I new at this) assuming that means I can?t include php directly in the template. So if that is true where do I place this function so that I can control which header is called in the forum_home template? (I used footer in place of my second header name so it was easy to see if this worked or not)
ps; if this isn't where this post should be, someone please move it where it should
go
As always thanks for your time
<?php
function doriteheader() {
// serve correct header by browser
global $HTTP_USER_AGENT;
if (eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
return "$footer";
} else { // other browsers
return $header;
}
}
?>
I tried placing this in the template, but that didn?t work so I am (don?t laugh too hard I new at this) assuming that means I can?t include php directly in the template. So if that is true where do I place this function so that I can control which header is called in the forum_home template? (I used footer in place of my second header name so it was easy to see if this worked or not)
ps; if this isn't where this post should be, someone please move it where it should
go
As always thanks for your time