Jump to content

If statement


le007

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/72856-if-statement/
Share on other sites

    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 <[email protected]>'.$eol;

$headers .= 'Reply-To: Webdev01 <[email protected]>'.$eol;

$headers .= 'Return-Path: Webdev01 <[email protected]>'.$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 = "[email protected]";

$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

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/72856-if-statement/#findComment-367419
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.