File: D:/HostingSpaces/SBogers10/promic.komma.pro/wwwroot/en/kms_new/afmelden_account.php
<?php
session_start();
header("Content-Type: text/html; charset=UTF-8");
include("connect.php");
if (isset($_POST['verzenden']))
{
$verzenden = "true";
}
if (isset($_POST['emailadres']))
{
$emailadres=$_POST['emailadres'];
$emailadres=strtolower($emailadres);
if(ereg("^[a-z0-9_.-]*@[a-z0-9_.-]*[.][a-z]*([.][a-z]*)?$",$emailadres)){
$valid_mail = "true";
}
};
if (isset($_POST['verzenden']) && $valid_mail == "true"){
$datumin = date("d-m-Y");
$query = "SELECT * FROM accounts WHERE emailadres ='$emailadres'";
$result2 = mysql_query($query);
$record2 = mysql_fetch_assoc($result2);
$aanhef = $record2['aanhef'];
$achternaam = $record2['achternaam'];
$wachtwoord = $record2['wachtwoord'];
$data_mailadres = $record2['emailadres'];
$code = $record2['code'];
if($result2){
if($data_mailadres != $emailadres){
$getest = false;
}else{
$adminaddress = "info@promic.com";
$onderwerp = "De-activation account Promic.com";
$link = "http://www.promic.nl/english/kms/deactivatie_account.php?EMAIL=".$emailadres."&CODE=".$code."";
$van = "FROM:$adminaddress";
$bericht = "\n
Dear $aanhef $achternaam,
We are sorry to see you’ve decided to de-activate your Promic account.
You can always register again at our website to activate your account again.
Please click the link below to actually de-activate your account at Promic B.V.
In case the link does not work, please copy the URL and paste it into a new browser window.
In case you’ve received this message unsolicited, another user probably used your email
address when de-activating another account. As long as you do not click the link,
your de-activation request is NOT completed, so de-activation will not take place.
$link
With kind regards,
Promic B.V.
Kluttershoek 7
6027 PT Soerendonk
The Netherlands";
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
$send_message = mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
if ($send_message) {
$_SESSION['geslaagd'] = "goed";
}else{
$_SESSION['geslaagd'] = "fout";
}
}
mail_utf8($emailadres, $onderwerp, $bericht, $van);
$_SESSION['aanhef'] = $aanhef;
$_SESSION['achternaam'] = $achternaam;
header("Location: bedankt_afmelden_account.php");
exit();
}
}else{
$_SESSION['aanhef'] = "sir/madam";
$_SESSION['geslaagd'] = "fout";
header("Location: bedankt_afmelden_account.php");
exit();
}
}
//-----------------------------------------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="myKMS.css" rel="stylesheet" type="text/css" />
<title>De-activation account</title>
</head>
<body bgcolor="#FFFFFF" class="style1">
<center><div id="logo"><p><br /><a href="http://www.promic.nl" target="_blank"><img src="promic_logo.jpg" alt="Promic B.V." width="250" height="80" border="0"/></a></p></div></center>
<div id="vlakvlak"><div id="vlak"><div id="vlak2">
<table width="850" border="0">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"/>
<tr>
<td width="262" scope="col"> </td>
<th width="308" scope="col"><strong>Please fill up the email address that is being used for your personal account:</strong></th>
<th width="280" scope="col"> </th>
</tr>
<tr>
<td scope="col"><span class="style1"><strong></strong></span></td>
<td><input name="emailadres" type="text" id="emailadres" class="style2" value = "<?php print($emailadres) ?>" size="46"/></td>
<td><?php if ($verzenden == "true" && $valid_mail != "true"){
print ("Please fill up your email address correctly");
}
if($getest == false && $valid_mail == "true"){
print("You’ve filled up a wrong email address, or an email address that does not exist in our data system.");
}?></td>
</tr>
<tr><td><br /></td><td><br /></td></tr>
<tr>
<td></td>
<td><center><input type="submit" name="verzenden" id="verzenden" value="De-activation account" /></center></td>
</tr>
</form>
</div></div></div>
</body>
</html>