include ('connect.php');
$email = $_POST['payer_email'];
$password = md5($email);
if (isset($email))
{
$first = $_POST['first_name'];
$last = $_POST['last_name'];
$num = $_POST['num_cart_items'];
for ($i=1;$i<=$num;$i++)
{
$itemname = $_POST['item_name'.$i];
$itemnumber = $_POST['item_number'.$i];
$sql = mysql_query("insert into digbuyers (email,password,fileid)
values ('$email','$password','$itemnumber')");
$link = $password.'_'.$itemnumber;
$linktosend .= ''.$itemname.'
';
}
$content = 'Thank you for purchasing the following songs. Click on the links to download them
'.$linktosend;
mail($email,"Your mp3 purchase",$content,"Content-type: text/html");
}
?>