php email. how does it know to populate certain fields
<p>so im learning php (begginer if you cant tell) and, im currently pushin/pulling data from the db to a page so that it can then populate other parts of the page and when "send" is hit, it puts it all together and sends right...</p>

<p>my question is, </p>

<p>i know to set for example:</p>

<pre><code>$to = 'email@gmail.com'; 
$subject = 'test from my email php script'; 
$email = $_POST['email']; 
$name = $_POST['fname']; 
$lastname = $_POST['lname']; 
$mssg = $_POST['mssg'];
</code></pre>

<p>but how does php or the mail app on the server know which field goes where since these are 
self made variables???</p>

<p>so for example if i say:</p>

<pre><code>mail($to, $subject, $name, $lastname, $mssg);
</code></pre>

<p>how does it know to put say "subject" in the emails subject area and not all together in the mesage field etc?</p>

<p>i have a few pages open but none explain the WHY or better et, the HOW</p>

<p>thanks in advance.</p>
