title: Adding custom PHP form to Wordpress
body: <p>I'm still rather new to PHP, I've coded a form, but its purpose is going to be adding it onto a page in Wordpress, the only thing is, I'm not sure how I would go about doing so (in the quickest and easiest way possible) </p>
  
  <p>Here's the current code:</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['person1'])) $person1 = $_POST['person1'];
  if (isset($_POST['person2'])) $person2 = $_POST['person2'];
  $multivar = 4;
  $answer = ($person1 + $person2) * $multivar;
  
  echo &lt;&lt;&lt;_END
  &lt;form method='post' action='index.php'&gt;
  &lt;table border='0' width='500px' cellpadding='3' cellspacing='1' class="table"&gt;
  &lt;tr class="calcheading"&gt;&lt;td colspan="2"&gt;&lt;strong&gt;How much can you borrow?&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr class="calcrow"&gt;&lt;td&gt;Person 1 income:&lt;/td&gt;&lt;td align="center"&gt;&lt;input type='text' name='person1' value="$person1"/&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr class="calcrow2"&gt;&lt;td&gt;Person 2 income&lt;/td&gt;&lt;td align="center"&gt;&lt;input type='text' name='person2' value="$person2"/&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr class="submit"&gt;&lt;td colspan="2"&gt;&lt;input type='submit' value='Calculate'/&gt;&lt;/td&gt;&lt;/tr&gt;
  _END;
  ?&gt;
  
  &lt;tr class="calcrow"&gt;
  &lt;td&gt;&lt;i&gt;You can borrow up to:&lt;/td&gt;
  &lt;td align="center"&gt;&lt;input type="text" value="&lt;?php echo round($answer)?&gt;"&gt;&lt;/td&gt;&lt;/i&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>I was thinking, if I split the PHP code off into a separate .php file, then use the HTML form inside the Wordpress page, and change the form action to the name of the file, then it would work, however for some reason when I attempted it that way, it never worked.</p>
  
  <p>Any assistance would be greatly appreciated.</p>