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-mediadesign.nl/wwwroot/es/kms_new/aanmelden_nieuwsbrief.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)){
		$lengte2 = strlen($bedrijfsnaam);
		if($lengte2 > 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)){
		$lengte2 = strlen($telefoon2);
		if($lengte2 > 5){
			$valid_telefoon = "true";
		}
	}
};
if (isset($_POST['voornaam']))
{
	$voornaam=$_POST['voornaam'];
	if(ereg("^[A-Za-z. ]*$",$voornaam)){
		$lengte2 = strlen($voornaam);
		if($lengte2 > 2){
			$valid_voornaam = "true";
		}
	}
};
if (isset($_POST['achternaam']))
{
	$achternaam=$_POST['achternaam'];
	if(ereg("^[A-Za-z. ]*$",$achternaam)){
		$lengte2 = strlen($achternaam);
		if($lengte2 > 2){
			$valid_achternaam = "true";
		}
	}
};
if (isset($_POST['geslacht']))
{
	$geslacht=$_POST['geslacht'];
};
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_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_nieuwsbrief.php?EMAIL=" . $emailadres. "&CODE=" . $code ."";
	
	if($geslacht =="man"){
		$aanhef = "sir";
	}else{
		$aanhef = "madam";
	}
	
	$mailadres = "SELECT emailadres FROM emailadressen 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 = "Verification e-mailadres Promic.nl";
			$van = "FROM:$adminaddress";
			$bericht = "\n
Dear $aanhef $achternaam,

Welcome at Promic B.V. Please click the link below to activate and complete your sign-in 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 

In case you’ve received this message unsolicited, another user probably used your email address when signing in for another account. 
As long as you do not click the link, your sign-in request is NOT completed, so signing in will not be activated.\n

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 emailadressen(bedrijfsnaam, telefoonnummer, voornaam, achternaam, aanhef, emailadres, wachtwoord, datumin, code, geactiveerd, status, taal, categorie) VALUES ('$bedrijfsnaam', '$telefoon2', '$voornaam', '$achternaam', '$aanhef', '$emailadres', '$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_nieuwsbrief.php");
			exit();
		}
	}else{
		$_SESSION['aanhef'] = "sir/madam";
		$_SESSION['geslaagd'] = "fout";
		$_SESSION['emailadres'] = $emailadres;
		header("Location: bedankt_aanmelden_nieuwsbrief.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>Sign in for the Promic news letter</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 all required personal data.</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><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>