le007 Posted October 11, 2007 Share Posted October 11, 2007 if ( $area == "thisarea" ) { echo "You're home"; } elseif( $price == "100" ) { echo " "; I need an if for both conditions, basically if area is "thisarea" and price is 100 then I want nothing echoed at all. How can this be done? How can I add 2 if's... if a = b and c = d then echo " " Thanks Quote Link to comment Share on other sites More sharing options...
Orio Posted October 11, 2007 Share Posted October 11, 2007 if( condition1 && condition2) Meaning- if($area == "thisarea" && $price == "100") && - means AND (both must be true) || - means OR (at least one needs to be ture) Orio. Quote Link to comment Share on other sites More sharing options...
le007 Posted October 11, 2007 Author Share Posted October 11, 2007 Top man, thank you Quote Link to comment Share on other sites More sharing options...
hamza Posted October 11, 2007 Share Posted October 11, 2007 This is my code <body> <?php // # Is the OS Windows or Mac or Linux if (strtoupper(substr(PHP_OS,0,3)=='WIN')) { $eol="\r\n"; } elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) { $eol="\r"; } else { $eol="\n"; } # Common Headers $headers .= 'From: Webdev01 <webdev01@yahoogroups.com>'.$eol; $headers .= 'Reply-To: Webdev01 <webdev01@yahoogroups.com>'.$eol; $headers .= 'Return-Path: Webdev01 <webdev01@yahoogroups.com>'.$eol; $headers .= "Message-ID: <TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters # Boundry for marking the split & Multitype Headers $headers .= 'MIME-Version: 1.0'.$eol; //$headers .= "Content-type: text/plain; charset=iso-8859-1".$eol; $headers .= "Content-type: text/html; charset=iso-8859-1".$eol; $to = "myemail@someone.com"; $subject = "Test Mail"; $msg = "Hi, <br> Testing"; if(mail($to, $subject, $msg, $headers)) echo "mail sent...."; else echo "error..."; ?> </body> Problem : when i was send this kind of code it will show me that mail is send successfully . but in actually mail is not sende. And my php.ini and please tell me about the php.ini file thanks in advance Quote Link to comment Share on other sites More sharing options...
prime Posted October 11, 2007 Share Posted October 11, 2007 you can use && or AND both are the same thing in this case Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted October 11, 2007 Share Posted October 11, 2007 &&, ||, ! are the preferred syntaxes. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 11, 2007 Share Posted October 11, 2007 ^ so true Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.