if/else statement not working right - SOLVED

it should be simple. I just made a simple madlib form at http://www.matthewrdaniels.com/php/form4.html

and when you fill in the textboxes it generates a madlib. I decided I wanted to include an if/else statement to give you another sentence after the madlib which goes like this:

if ($one == “watermelons”) && ($two == “smelly”) {
echo “Hey! You copied Stewie! How very uncreative of you.”;
} else {
echo “Haha! Oh, how ruthlessly ubsurd.”;

when i submit the form, i get the following error.

Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/mattrd/public_html/php/form4.php on line 25

I know I’m supposed to use two amps. If i only use one, it tells me it expecting another “&.” so I add it and i get the above error. Am I overlooking something very very simple in my code? any help would be appreciated. thank you.

just wanted to let you know i figured it o ut. I didn’t realize I had to enclose the entire first if statement in parenthesis.

Sponsor our Newsletter | Privacy Policy | Terms of Service