Forum Moderators: open
Watch the "pipes" in the code.
but i am looking for some sort of php code i can incorporate into he my php header file containing the offending menue that will simply serve the different menues within the same page, one opera specific - server side from the php app -
many thanks
var sBrowser = "" + Request.ServerVariables ( 'HTTP_USER_AGENT' );
if ( -1 == sBrowser.indexOf ( 'Mozilla' ) )
{
// an unknown browser - probably opera
Out ( '<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>this table conatins menue - opera</td>
</tr>
</table>
">' );
else {
// a browser - mozilla
Out ( '<<tr>
<td>this table conatins menue -non opera</td>
</tr>
</table>">' );
}
Mozilla/3.0 (Windows 98; U) Opera 6.0 [en]
Mozilla/4.76 (Windows 98; U) Opera 6.0 [en]
Mozilla/5.0 (Windows 98; U) Opera 6.0 [en]
Opera/6.0 (Windows 98; U) [en]
...so David's solution looks good, or here's another:
$UA = getenv(HTTP_USER_AGENT);
if (strstr($UA,"Opera")) {
echo ("You're using Opera.");
}
If this is a parsed php page
<? //Start php mode
if (eregi("opera",$HTTP_USER_AGENT)){
$BROWSER_NAME="OPERA";
}
if ($BROWSER_NAME == "OPERA"){
?> //escape php for html
<td> Your Opera Menu </td>
<? //finish the if statement
}
?>
What this does is searches the nix server variable for the user agent and if Opera is in that string it assigns OPERA to $BROWSER_NAME
Then you would check $BROWSER_NAME for Opera and if its true insert your menu. If you are on a windows box then maybe the server variable is different.
i am unix - running an app called phpshop.org
i have stubmled through coding with alot of help from the phpshop group but this menue thing has me stuck ---
i will take a look at your info and try it out --
the offending url:
[webshop101.com...]