HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/promic.komma.pro/wwwroot/english/kms/aanmelden_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['bedrijfsnaam']))
{
	$bedrijfsnaam=$_POST['bedrijfsnaam'];
	if(ereg("^[A-Za-z0-9 _.-]*$",$bedrijfsnaam)){
		$lengte6 = strlen($bedrijfsnaam);
		if($lengte6 > 2){
			$valid_bedrijfsnaam = "true";
		}
	}
};
if (isset($_POST['telefoon']))
{
	$telefoon=$_POST['telefoon'];
	$telefoon2 = str_replace("-","",$telefoon);
	$telefoon2 = str_replace(" ","",$telefoon2);
	$telefoon2 = str_replace("+","00",$telefoon2);
	if(ereg("^[0-9]*$",$telefoon2)){
		$lengte5 = strlen($telefoon2);
		if($lengte5 > 5){
			$valid_telefoon = "true";
		}
	}
};
if (isset($_POST['voornaam']))
{
	$voornaam=$_POST['voornaam'];
	if(ereg("^[A-Za-z. ]*$",$voornaam)){
		$lengte4 = strlen($voornaam);
		if($lengte4 > 2){
			$valid_voornaam = "true";
		}
	}
};
if (isset($_POST['achternaam']))
{
	$achternaam=$_POST['achternaam'];
	if(ereg("^[A-Za-z. ]*$",$achternaam)){
		$lengte3 = strlen($achternaam);
		if($lengte3 > 2){
			$valid_achternaam = "true";
		}
	}
};
if (isset($_POST['geslacht']))
{
	$geslacht=$_POST['geslacht'];
};
if (isset($_POST['wachtwoord']))
{
	$wachtwoord=$_POST['wachtwoord'];
	if(ereg("^[A-Za-z0-9]*$",$wachtwoord)){
		$lengte = strlen($wachtwoord);
		if($lengte > 5){
			$valid_wachtwoord = "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" && $valid_wachtwoord == "true" && $valid_bedrijfsnaam == "true" && $valid_telefoon == "true" && $valid_voornaam == "true" && $valid_achternaam == "true" && !empty($geslacht)){ 
	$datumin = date("d-m-Y");
	$Password="";
	for ($i=1;$i<=10;$i++){
		$trap=rand(0,18);
		$Password=$Password.substr("abcdefghkm123456789",$trap,1);
	}
	$code=strtoupper($Password);

	$link_user= "http://www.promic.nl/english/kms/activatie_account.php?EMAIL=" . $emailadres. "&CODE=" . $code ."";
	
	if($geslacht =="man"){
		$aanhef = "sir";
	}else{
		$aanhef = "madam";
	}
	$mailadres = "SELECT emailadres FROM accounts WHERE emailadres ='$emailadres'";
	$result2 = mysql_query($mailadres);
	$record2 = mysql_fetch_assoc($result2);
	$data_mailadres = $record2['emailadres'];
	if($result2){
		if($data_mailadres == $emailadres){
			$getest = true;
		}else{
			$adminaddress = "info@promic.nl";
			$onderwerp = "Account activation Promic.nl";
			$van = "FROM:$adminaddress";
			$bericht = "\n
Dear $aanhef $achternaam,

Welcome at Promic B.V. Please click the link below to complete your account request and same time, 
to verify your email address. In case the link does not work, please copy the URL and paste it into a new browser window.\n
$link_user \n
You hereby receive your personal account data once more:
Your email address is your username: $emailadres
Password:  $wachtwoord

Please note that your account request first needs to be accepted by Promic B.V. 
before it will be actually activated. This will take 48 hours maximum.


In case you’ve received this message unsolicited, another user probably used your email address when applying for another account. 
As long as you do not click the link, your account request is NOT completed, so activation can never take place.

We hope your Promic account will be useful to you !

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";
				global $send_message;
				$send_message = mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
			}
			mail_utf8($emailadres, $onderwerp, $bericht, $van);
			
			if ($send_message) {
				$query = "INSERT INTO accounts(bedrijfsnaam, telefoonnummer, voornaam, achternaam, aanhef, emailadres, wachtwoord, datumin,	code, geactiveerd, status, taal, categorie) VALUES ('$bedrijfsnaam', '$telefoon2', '$voornaam', '$achternaam', '$aanhef', '$emailadres', '$wachtwoord', '$datumin', '$code', 'nee', 'closed', 'Engels', 'A')";
				$result = mysql_query($query);
				$_SESSION['geslaagd'] = "goed";
			}else{
				$_SESSION['geslaagd'] = "fout";
			}
			$_SESSION['aanhef'] = $aanhef;
			$_SESSION['achternaam'] = $achternaam;
			$_SESSION['emailadres'] =$emailadres;
			header("Location: bedankt_aanmelden_account.php");
			exit();
		}
	}else{
		$_SESSION['aanhef'] = $aanhef;
		$_SESSION['achternaam'] = $achternaam;
		$_SESSION['geslaagd'] = "fout";
		header("Location: bedankt_aanmelden_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>Account activation Promic.nl</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">&nbsp;</td>
    <th width="308" scope="col"><strong>Please fill up your data below:</strong></th>
    <th width="280" scope="col">&nbsp;</th>
  </tr>
  <tr>
    <td scope="col"><span class="style1"><strong>Company name: </strong></span><span class="style3">(no special characters allowed)</span></span></td>
    <td><input name="bedrijfsnaam" type="text" class="style2" id="bedrijfsnaam" value = "<?php print($bedrijfsnaam) ?>" size="46"/></td>
    <td><?php if ($verzenden == "true" && $valid_bedrijfsnaam != "true"){ 
   					print ("Please fill up your company name correctly"); 
					}?></td>
  </tr>
  <tr>
    <td scope="col"><span class="style1"><strong>Telephone number: </strong></span></td>
    <td><input name="telefoon" type="text" class="style2" id="telefoon" value = "<?php print($telefoon) ?>" size="46"/></td>
    <td><?php if ($verzenden == "true" && $valid_telefoon != "true"){ 
   					print ("Please fill up your telephone number correctly"); 
					}?></td>
  </tr>
  <tr>
    <td scope="col"><span class="style1"><strong>First name: </strong></span><span class="style3">(no special characters allowed)</span></span></td>
    <td><input name="voornaam" type="text" class="style2" id="voornaam" value = "<?php print($voornaam) ?>" size="46"/></td>
    <td><?php if ($verzenden == "true" && $valid_voornaam != "true"){ 
   					print ("Please fill up your first name correctly"); 
					}?></td>
  </tr>
    <tr>
    <td scope="col"><span class="style1"><strong>Last name: </strong></span><span class="style3">(no special characters allowed)</span></span></td>
    <td><input name="achternaam" type="text" class="style2" id="achternaam" value = "<?php print($achternaam) ?>" size="46"/></td>
    <td><?php if ($verzenden == "true" && $valid_achternaam != "true"){ 
   					print ("Please fill up your last name correctly"); 
					}?></td>
  </tr>
      <td scope="col"><span class="style1"><strong>Gender: </strong></span></td>
    <td>&nbsp;Man
      <input type="radio" name="geslacht" id="man" value="man" <?php if ($geslacht == "man") {print("checked= \"checked\"");} else{ print("");} ?>/>
      Woman
      <input type="radio" name="geslacht" id="woman" value="woman" <?php if ($geslacht == "woman") {print("checked= \"checked\"");} else {print("");}?>/></td>
    <td><?php if ($verzenden == "true" && empty($geslacht)){ 
   					print ("Please fill up your gender"); 
					}?></td>
  </tr>
  <tr>
    <td scope="col"><span class="style1"><strong>E-mailaddress:</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 == true && $valid_mail == "true"){
						print("This email address has already been registered. Please use another email address or use your other account.");
					}?></td>
  </tr>
  <tr>
    <td scope="col"><span class="style1"><strong>Password:</strong></span> <span class="style3">(6 characters minimum, only numbers and letters allowed)</span></td>
    <td><input name="wachtwoord" type="password" class="style2" id="wachtwoord" value = "<?php print($wachtwoord) ?>" size="46"/></td>
    <td><?php if ($verzenden == "true" && $valid_wachtwoord != "true"){ 
   					print ("Please fill up your password correctly"); 
					}?></td>
  </tr>

  <tr><td><br /></td><td><br /></td></tr>
  <tr>
  <td></td>
    <td><center><input type="submit" name="verzenden" id="verzenden" value="Register" /></center></td>
  </tr>
</form>
</div></div></div>
</body>
</html>