title: After input form, how do you access the value that was input, into a variable later in the html/php file?
body: <p>I'll be thrilled with any solution that will do that.  Here's what I've been trying:</p>
  
  <p>I have an input form that gets variable info.  I want to email using php mail(), the variable info that was input.  I've put the php mail() later in the same html/php file (I haven't used js in here at all).  I can't figure out how to access those input variable values, to put into the mail() function.</p>
  
  <pre><code>&lt;form target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;br&gt;
  Donation Amount $: &lt;input type="text" name="amount" size="20"&gt; &lt;br&gt;
  Instructions to us: 
  &lt;textarea name="eventcardinstructions" rows=6 cols=60&gt;&lt;/textarea&gt;&lt;br&gt;
  &lt;input type="hidden" name="add" value="1"&gt;
  &lt;input type="hidden" name="cmd" value="_cart"&gt;
  &lt;input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_SM.gif" border="0" name="submit"&gt;
  etc.
  &lt;/form&gt;  &lt;!-- closes the form and lets the user hit a submit button--&gt;
  </code></pre>
  
  <p>This is collecting inputs from the user to send to paypal.  It's working.  The user inputs an amount into an input field and instructions into a textarea.  The amount is sent to paypal.  The textarea instructions ARE NOT SENT to paypal, which is what I want.</p>
  
  <p>Later (before the form ends OR) after end of form and the submit button that sends this to paypal, I want to reference the "amount" and "instructions" in php mail() function.  The mail() function is working and sends emails.  It just ignores and doesn't send the variable amounts.  So the emails say:</p>
  
  <pre><code>     Subjectline: Event Card
       Body contents:  Event card bought for 
  </code></pre>
  
  <p>The mail function is:</p>
  
  <pre><code>    &lt;?php   
       // headers allow the email to recognize html with in the 
       // message &amp; process it.
      $headers = "MIME-Version: 1.0\r\n";          
      $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";      
     $eventcardmsg = "Event card bought for " . $_POST['amount'];
     $eventcardmsg = $eventcardmsg .= $_POST['eventcardinstructions'];
     mail("email@ourdomain.net", "Event Card", $eventcardmsg, $headers);
  </code></pre>
  
  <p>?> </p>
  
  <p>How do I setup amount and eventcardinstructions so the values are used?</p>
  
  <p>I see a couple related q&amp;as but can't figure it out from them.  This answer is using it the same way I am by using the $_POST['variable'];  but it's not working for me.
  <a href="https://stackoverflow.com/questions/30016669/how-do-you-save-a-inputs-value-in-a-variable">https://stackoverflow.com/questions/30016669/how-do-you-save-a-inputs-value-in-a-variable</a></p>
  
  <p>This one:
  <a href="https://stackoverflow.com/questions/11226290/assign-input-form-to-a-variable">Assign input form to a variable</a>  looks like it's using php in the middle of the html input form to set the variable.  I could try that, but seems odd to need to, like I'm not understanding something.</p>
  
  <p>Thanks!!</p>