title: How to combine "and" statements and "if"statements in PHP?
body: <p>I am trying to write a check for Vendors and models in a form I have put together</p>
  
  <p>Here is the relavent part of the form</p>
  
  <pre><code>&lt;table  width="75%"&gt;
  &lt;form action="?" method="post"&gt;
  &lt;tr&gt;
  &lt;td colspan="6" align="center"&gt;
  &lt;font size="5"&gt;&lt;b&gt;Add new record&lt;/b&gt;&lt;/font&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="right"&gt;
  &lt;b&gt;Vendor:&lt;/b&gt;
  &lt;/td&gt;
  &lt;td&gt;
  &lt;select name="vendor"&gt;
  &lt;option value="ClearAccess"&gt;ClearAccess&lt;/option&gt;
  &lt;option value="VisionNet"&gt;VisionNet&lt;/option&gt;
  &lt;option value="Other"&gt;Other&lt;/option&gt;
  &lt;/select&gt;
  &lt;/td&gt;
  &lt;td align="right"&gt;
  &lt;b&gt;Model:&lt;/b&gt;
  &lt;/td&gt;
  &lt;td&gt;
  &lt;select name="model"&gt;
  &lt;option value="NotModel"&gt;--ClearAccess--&lt;/option&gt;
  &lt;option value="AG10W"&gt;AG10W&lt;/option&gt;
  &lt;option value="SR100G"&gt;SR100G&lt;/option&gt;
  &lt;option value="SR300N"&gt;SR300N&lt;/option&gt;
  &lt;option value="SR350N"&gt;SR350N&lt;/option&gt;
  &lt;option value="SR500N"&gt;SR500N&lt;/option&gt;
  &lt;option value="NotModel"&gt;--VisionNet--&lt;/option&gt;
  &lt;option value="M404"&gt;M404&lt;/option&gt;
  &lt;option value="M405"&gt;M405&lt;/option&gt;
  &lt;option value="M505"&gt;M505&lt;/option&gt;
  &lt;option value="M505n"&gt;M505N&lt;/option&gt;
  &lt;option value="Legacy"&gt;Legacy&lt;/option&gt;
  &lt;/select&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>my form is good.  my issue is when I am building my if loop.  Here is what I have so far</p>
  
  <pre><code>if ($_POST['vendor']='ClearAccess') &amp;&amp; ($_POST['model']='M404') || ($_POST['model']='M405') || ($_POST['model']='M505') || (_$POST['model']='M505N') || ($_POST['model']='Legacy')
  echo "You have not selected a valid vendor/model combination"
  </code></pre>
  
  <p>I am having an issue with where and how to place my parenthesis.</p>
  
  <p>I am also going to create an if statement similar to this</p>
  
  <pre><code>if ($_POST['vendor']='VisionNet') &amp;&amp; ($_POST['model']='AG10W') || ($_POST['model']='SR100G') || ($_POST['model']='SR300N') || (_$POST['model']='SR350N') || ($_POST['model']='SR500N')|| ($_POST['model']='Legacy')
  echo "You have not selected a valid vendor/model combination"
  </code></pre>
  
  <p>I am completely open to doing it different ways.  Eventually I will turn this into java script where you pick a vendor and get only the relavant models for that vendor.  Put as I am still learning PHP and have not learned even the basics of Java yet I want to try it this way.</p>