Hi Busby,
Not too sure what you are after, but maybe this script can help, if you need me to explain it, just ask 🙂
<?php
session_start();
$id=$_SESSION['user_id'];
$connect=mysql_connect("localhost","some_user","some_password");
$select=mysql_select_db("database",$connect);
$query_users=mysql_query("SELECT * FROM users WHERE id=''$id" );
while($row=mysql_fetch_array($query_users)){
$user=$row['username'];
$has_bought=$row['bought'];
}
$emailSubject = 'testemail';
$webMaster = 'someuser@somedomain.com';
$firstname = "Website";
$lastname = "Admin";
$email = "php@script.com";
$description = "Test email!";
$body = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'><html><head>
<style>
<!--
body
{
background-color: #000000;
color: #FFFFFF;
}
#mess{
text-align:center;
font-size:24px;
font-family:'Arial Black';
}
-->
</style>
</head>
<body>
<div id='mess'>
Hello $user,<br /><br />if ($has_bought==true){You are a paid member!}else{click <a href=\"member_buy.html\">Here!</a> to become a member.}</div>
</div>
</body>
</html>
";
$headers = "From: php@script.co.uk\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers); //<<
$theResults = <<<EOD
(Message sent successful, worked!)
EOD;
echo "$theResults";
?>
I quickly typed the script up so if there is any errors please ask and i will correct them.