Lets just take a simple example
First make a form with plain old HTML
<html>
<body>
<form name='myform' action='testform.php' method ='post'><br />
First Name: <input type='text' name='firstname' /><br />
Last Name : <input type='text' name='lastname' /><br />
E-mail: <input type='text' name='email' /><br />
<input type='submit' name ='test' value='Send It' />
</form>
</body>
</html>
The above has a action of testform.php and when you press, mash, strike or hit the submit button (this one says Send it) the browser will look for a file named testform.php . So now you need a PHP file named testform.php which will precess the information provided by the form above so lets make one and name it testform.php, and make sure that it is in the same folder (directory) as the above file.
<?php
if(isset($_POST['test']))
{
//create some short variables
$first = $_POST['firstname'];
$last = $_POST['lastname'];
$email = $_POST['email'];
echo "Welcome $first $last to our site!<br />";
echo "You entered your E-mail as $email is this correct?";
}
else
{
echo "You did not use the form to get here!";
exit;
}
?>
Place those two simple files on your webserver and run it to see how it works. You will need to get the basics down first before you want to try to use functions like mail() which can be rather simple or quite complex if you want to send HTML and inline attachments.