if (ereg("MSIE",$browser) && ereg("WIN", $browser))
{
    //do your funcky jazz here
}

later,

Ryan "BigPimpin" Byrd

----- Original Message ----- 
From: "Wade Preston Shearer" <[EMAIL PROTECTED]>
To: "BYU UUG Post" <[EMAIL PROTECTED]>
Cc: "PLUG POST" <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 2:05 PM
Subject: [uug] php syntax help - operator "AND"


> can anyone help my with this syntax?
> 
> i'm trying to add a browser sniffer snippet (this isn't the real code) 
> to my leech script (yes, the one that i have already posted a few times 
> about)... that will do A if MSIE on windows, or B if anything else...
> 
> it works to match one expression to $browser, but i need to match two 
> parts of the expression (because there is more than on OS running MSIE 
> and there is more than one browser on microsoft windows)...
> 
> 
> 
> $browser = $_SERVER['HTTP_USER_AGENT'];
> 
> if (preg_match("/MSIE/i" AND "/Win/i", "$browser"))
> {
> echo "you suck, you're using MSIE on Windows";
> }
> else
> {
> echo "congrats, you use a real browser";
> }
> 
> 
> 
> ____________________
> BYU Unix Users Group 
> http://uug.byu.edu/ 
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to