title: PHP if statement - select two different get variables?
body: <p>Below is my example script: </p>
  
  <pre><code>&lt;li&gt;&lt;a &lt;?php if ($_GET['page']=='photos' &amp;&amp; $_GET['view']!=="projects"||!=="forsale") { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos\""); } ?&gt;&gt;Photos&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a &lt;?php if ($_GET['view']=='projects') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&amp;view=projects\""); } ?&gt;&gt;Projects&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a &lt;?php if ($_GET['view']=='forsale') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&amp;view=forsale\""); } ?&gt;&gt;For Sale&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I want the PHP to echo the <strong>"href="#" class="active"</strong> only when it is not on the two pages:</p>
  
  <p><strong>?page=photos&amp;view=forsale</strong> </p>
  
  <p>or </p>
  
  <p><strong>?page=photos&amp;view=projects</strong></p>
  
  <p>I've also tried this and it doesnt work:</p>
  
  <pre><code>&lt;li&gt;&lt;a &lt;?php if ($_GET['page']=='photos' &amp;&amp; ($_GET['view']!=='projects' || $_GET['view']!=='forsale')) { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos\""); } ?&gt;&gt;Photos&lt;/a&gt;&lt;/li&gt;
  </code></pre>