############### Code
<?
include('config.php');
$tbl_name=temp_members_db;
$confirm_code=md5(uniqid(rand()));
$name=$_POST['name'];
$email=$_POST['email'];
$country=$_POST['country'];
$sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')";
$result=mysql_query($sql);
if($result){
// ---------------- SEND MAIL FORM ----------------
$to=$email;
$subject="Your confirmation link here";
$header="from: your name <your email>";
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$message.="http://www.yourweb.com/confirmation.php?passkey=$confirm_code";
$sentmail = mail($to,$subject,$message,$header);
}
else {
echo "Not found your email in our database";
}
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send Confirmation link to your e-mail address";
}
?>
|