Code:
<?php
//print_r($_REQUEST);
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("moes", $link);
$confirm_code= md5(uniqid(rand()));
$fname=$_POST['First_Name'];
$lname=$_POST['Last_Name'];
$address=$_POST['Address'];
$country=$_POST['Country'];
$state=$_POST['State'];
$city=$_POST['City'];
$pincode=$_POST['Pincode'];
$cnumber=$_POST['Contactno'];
$gender=$_POST['Gender'];
$birthday=$_POST['Year'].'-'.$_POST['Month'].'-'.$_POST['Day'];
$email=$_POST['Email_Id'];
$password1=$_POST['Password1'];
$encrypted_mypassword1=md5($password1);
$password2=$_POST['Password2'];
$encrypted_mypassword2=md5($password2);
$query="INSERT INTO user_registration(first_name,last_name,address,city,state,pincode,country,contact_number,gender,date_of_birth,email_id,password1,password2) VALUES ('$fname','$lname','$address','$city','$state','$pincode','$country','$cnumber','$gender','$birthday','$email','$encrypted_mypassword1','$encrypted_mypassword2')";
$success=mysql_query($query, $link);
if($success) {
$to = $email;
$subject = 'Confirm your account with MOES';
$message="Your Comfirmation link \r\n";
// $message.="Click on this link to activate your account \r\n";
//$message.="http://www.example.com/confirmation.php?passkey=$confirm_code";
$headers = "From: sender@yourdomain.com rn";
$sentmail=mail($to,$subject,$message,$header);
}
if($sentmail)
{
echo "your confirmaiton link has been send to your account";
$header = 'Location: http://localhost/client/thankyou.php';
}
else {
echo "can not send confirmation link to your account";
}
?>
Warning: mail() [function.mail]: "sendmail_f rom" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs \clientc\action .php on line 34
can not send confirmation link to your account
Comment