this part of code send a email to user if they forgot there password.
first question i have is how can i add string and variables. this give me error
Parse error: syntax error, unexpected ':' in C:\xampp\htdocs\login_test\forgotpassword.php on line 46
$body = "Hi " . $firtname_db . ",\n Your password is" . $password_db:
2nd question can any one make user if iam using mail() function right?
else
{
//success - send email
//get user name from table
$queryget = mysql_query("SELECT firstname FROM user WHERE username = '$user'") or die("query didnt work");
$row = mysql_fetch_assoc($queryget);
$firstname_db = $row['firstname'];
//old_passworrddb = get from table
$queryget = mysql_query("SELECT password FROM user WHERE username = '$user'") or die("query didnt work");
$row = mysql_fetch_assoc($queryget);
$password_db = $row['passwor'];
$to = $email;
$subject = "Forgot password";
$body = "Hi " . $firtname_db . ",\n Your password is" . $password_db:
echo $firstname . "/" .$username."/".$email."/";
if(mail($to, $subject, $body))
{
echo "message successfully sent";
}
else
{ echo "failed";}
}