Jump to content

AND OR Statement?


Cooper94

Recommended Posts

Is there something like an AND OR statement. So say if only one part of the form was filled out than show the results of what was typed in. But if they enter both feilds in the form it will show the ony result. I am trying to make a search basicly so if they enter something it will show them were they could go. If you understand great if not :(

Thank You

Link to comment
https://forums.phpfreaks.com/topic/138221-and-or-statement/
Share on other sites

I think you are looking for IF ELSEIF and ELSE statements.

 

example

 

if($result1 == "hello") \\if the result is hello
{
echo "hello";
}
elseif($result2 == "hello again") \\if the result is hello again
{
echo "hello again";
}
else \\if it isn't hello or hello again
{
echo "nothing";
}

 

that is just a basic example but is that what yo uare looking for

Link to comment
https://forums.phpfreaks.com/topic/138221-and-or-statement/#findComment-722618
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.