title: Why is my form input not working when I put php code in it? Is there is some syntax error that I am unaware of?
body: <p>I have run into problems in the past with </p>
  
  <pre><code>&lt;form action="..." method="post"&gt;&lt;/form&gt; 
  </code></pre>
  
  <p>when I put paragraph or similar html tags within it.  Is there something similar that could cause my form to not be working here?  I am trying to get the submit button to go to "submit.php" upon clicking.  </p>
  
  <pre><code>&lt;form action="submit.php" method="post"&gt;
      &lt;?PHP
      //Default
      if(!session_id()) session_start();
      if(!isset($_SESSION['x'])) {
      $_SESSION['x'] = 0;
      }
      //Add new button for adding new links
      function addnew($x) {
      for($i = 0; $i &lt; $x; $i++) {
          if($i !== $x) {
      ?&gt;
      &lt;div align="center"&gt;
      &lt;table border=0"&gt;
          &lt;tr align="center"&gt;
              &lt;td&gt;
                  &lt;input type="text" name="keyword[]"&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="link[]"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
              &lt;?PHP
              if($_SESSION['x'] &lt; 1) {
                  echo "";
              } else {
                  if($i == ($x - 1)) {
                      //submit form here
                      ?&gt;
                      &lt;input type="submit" value="Submit"/&gt;            
                      &lt;?PHP
                  }
              }
          }
      }
      }
      ?&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>The point of all the session checking is to place my submit button on the end of my submit forms.  I am building a simple html input form where when you click a new input button a new input pops up, you can click the button to add as many as you want.  Basically I just need to know why my submit button won't work.  </p>
  
  <p>If this doesn't work I may just end up building the submit form ground-up from jquery.</p>