multiple variables inside an if statement?

Take a look at this code and tell me if it is possible to replace the words in the single quotes in the if statement with the variable names that are predefined -

		$word1="does";
		$word2="it";
		$word3="work";
		$word4="today";

some code goes here

      <?
      if (($_POST['radio1']) == 'thats' AND ($_POST['radio2']) == 'my' AND ($_POST['radio3']) == 'favorite' AND ($_POST['radio4']) == 'restaurant')
       {
        ?>
        <p>Well done! You got the correct answer.</p>
        <p>This is the question you formed:</p>
					<p><em>
        <?
            echo $_POST['radio1']." ";
            echo $_POST['radio2']." ";
            echo $_POST['radio3']." ";
            echo $_POST['radio4']."?";
        ?>

more code goes down here

I’ve tried several ways of doing it but it throws up errors.

Yes it is . What have you tried and what errors are you receiving?

I was afraid somebody would ask me to try to remember every permutation I have tried, but I don’t remember. Can’t you just tell me what to replace the individual words with to get the variables to work in the if statement?

You replace the words with the variables you want to use. I want to see what you tried to understand how you are receiving errors.

Sponsor our Newsletter | Privacy Policy | Terms of Service