well maybe some small snippet may help you.. each form input has name parameter, which is then used as the id, so in short you could do this :
<?php // === verify and send ===
$required = array("name", "number","email"); // set the required fields
$minleght = 1;
$err=0; // error counter set initially to 0
if (count($_POST)>0) // if there are some data sent
{ foreach ($required as $k) { if(!strlen($_POST[$k])<$minlegth)
{$err++; echo "fill the ".$k." field<br />";}}
// add custom field verication here?
}
// if no errors then build the messsage here
if ($err==0)
{ foreach($_POST as $kk=>$vv) { $mTxt.="$kk: $vv \r\n";} // get vars to text
// add some header if wished before sending
// (see php.net comments under function mail())
if (mail("recipient@domain.com", "subject here", wordwrap($mTxt,70)))
{ echo "thank you, email sent ok"; } else { echo "error sending the message"; }
}
if ($err>0 or count($_POST)<1)
{ include ("forms/form_1.htm");/* insert form here */ }
?>