2023-05-30 19:57:00 +02:00
|
|
|
|
<?php
|
|
|
|
|
session_start();
|
2023-06-05 11:37:55 +02:00
|
|
|
|
header('Content-Type: text/html; charset=UTF-8');
|
2023-06-05 13:44:55 +02:00
|
|
|
|
require('registriersystem.php');
|
2023-05-30 19:57:00 +02:00
|
|
|
|
if(isset($_POST['Registrieren'])){
|
|
|
|
|
$vorname = $_POST["vorName"];
|
|
|
|
|
$nachname = $_POST['nachName'];
|
|
|
|
|
$strasse = $_POST['strasse'];
|
|
|
|
|
$hausnummer = $_POST['hausnummer'];
|
|
|
|
|
$plz = $_POST['postleitzahl'];
|
|
|
|
|
$ort = $_POST['ort'];
|
|
|
|
|
$emailrep = $_POST['emailRep'];
|
|
|
|
|
$email = $_POST['email'];
|
|
|
|
|
$passwort = $_POST['passwort'];
|
|
|
|
|
$passwortrep = $_POST['passwortRep'];
|
|
|
|
|
if(empty($vorname) || empty($nachname) || empty($strasse) ||
|
|
|
|
|
empty($hausnummer) || empty($plz) || empty($ort) ||
|
|
|
|
|
empty($emailrep) || empty($email) || empty($passwort) || empty($passwortrep))
|
2023-06-05 11:37:55 +02:00
|
|
|
|
{
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
|
|
|
|
|
}elseif (!preg_match("/^[A-Za-zÄÖÜäöüß -]*$/", $vorname)
|
|
|
|
|
|| !preg_match("/.{2,}/", $vorname)
|
|
|
|
|
|| preg_match("/(?:([- ])\1{1,}|( -)|(- ))/", $vorname)
|
|
|
|
|
|| !preg_match("/^([A-ZÄÖÜa-zäöüß]{2,}[ -]?)+$/", $vorname)
|
|
|
|
|
|| !preg_match("/[a-zäöüß]$/", $vorname)
|
|
|
|
|
|| !preg_match("/^[A-ZÄÖÜ][a-zäöüß]+([- ][A-ZÄÖÜ][a-zäöüß]+)*$/", $vorname)
|
|
|
|
|
|| preg_match("/(\w)\1{2,}/", $vorname)) {
|
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
|
|
|
|
|
}elseif (!preg_match("/^[A-Za-zÄÖÜäöüß -]*$/", $nachname)
|
|
|
|
|
|| !preg_match("/.{2,}/", $nachname)
|
|
|
|
|
|| preg_match("/([-])\1{1,}/", $nachname)
|
|
|
|
|
|| !preg_match("/^([A-ZÄÖÜa-zäöüß]{2,}[ -]?)+$/", $nachname)
|
|
|
|
|
|| !preg_match("/[a-zäöüß]$/", $nachname)
|
|
|
|
|
|| preg_match("/[A-ZÄÖÜ][a-zäöüß]+[ ]+[A-ZÄÖÜ][a-zäöüß]+/", $nachname)
|
2023-06-06 13:23:20 +02:00
|
|
|
|
|| !preg_match("/^(von( der)?|zu|van)[ ][A-ZÄÖÜ]|^[A-ZÄÖÜ]/", $nachname)
|
|
|
|
|
|| !preg_match("/(^(von( der)?|zu|van)[ ][A-ZÄÖÜ][a-zäöüß]+|^[A-ZÄÖÜ][a-zäöüß]+)([-][A-ZÄÖÜ][a-zäöüß]+)?$/", $nachname)
|
2023-05-30 19:57:00 +02:00
|
|
|
|
|| preg_match("/(\w)\1{2,}/", $nachname)) {
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
|
|
|
|
|
}elseif ( !preg_match("/.{2,}/", $strasse)
|
|
|
|
|
|| !preg_match("/^[^0-9]*$|[0-9]$/", $strasse)
|
|
|
|
|
|| !preg_match("/^[A-Za-z0-9ÄÖÜäöüß' -]+$/", $strasse)
|
|
|
|
|
|| !preg_match("/^[A-ZÄÖÜ][ -]?[a-zäöü0-9ß']+([ -]?[A-ZÄÖÜ0-9][A-Za-z0-9ÄÖÜäöüß']+)*$/", $strasse)
|
|
|
|
|
|| !preg_match("/[0-9]$|[a-zäöüß]$/", $strasse)) {
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif ( !preg_match("/^[0-9]/", $hausnummer)
|
|
|
|
|
|| preg_match("/^0/", $hausnummer)
|
|
|
|
|
|| !preg_match("/^[1-9][0-9]{0,3}[a-z]?$/", $hausnummer)){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif ( !preg_match("/^(0100[1-9]|010[1-9][0-9]|01[1-9][0-9]{2}|0[2-9][0-9]{3}|[1-9][0-9]{4})$/", $plz)){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif ( !preg_match("/.{2,}/", $ort)
|
|
|
|
|
|| preg_match("/[ \/-][ \/-]/", $ort)
|
|
|
|
|
|| !preg_match("/^[A-ZÄÖÜa-zäöüß \/-]+$/", $ort)
|
|
|
|
|
|| preg_match("/(\w)\1{2,}/", $ort)
|
|
|
|
|
|| !preg_match("/^[A-ZÄÖÜ]/", $ort)
|
|
|
|
|
|| !preg_match("/[a-zäöüß]$/", $ort)
|
|
|
|
|
|| !preg_match("/^[A-ZÄÖÜ][a-zäöüß]+([ -\/][A-ZÄÖÜa-zäöü][a-zäöüß]+)*$/", $ort)){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif ( !preg_match("/[A-Za-z0-9_!#$%&'*+-\/=?^_`.{|}~]+[@][A-Za-z0-9-]+[.][A-Za-z]{2,}/", $email)){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif($email != $emailrep){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif (!preg_match("/^(?=.*[A-ZÄÖÜ])(?=.*[a-zäöüß])(?=.*[0-9])(?=.*[!°`´@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?]).{6,}$/", $passwort)
|
|
|
|
|
|| !preg_match("/.{6,}/", $passwort)){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}elseif($passwort != $passwortrep){
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
2023-06-12 16:17:49 +02:00
|
|
|
|
header("Location: registrierung_wiederholen.php");
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}else{
|
2023-05-30 21:51:35 +02:00
|
|
|
|
|
2023-06-05 11:37:55 +02:00
|
|
|
|
|
|
|
|
|
register($vorname,
|
2023-05-30 21:51:35 +02:00
|
|
|
|
$nachname ,
|
|
|
|
|
$email,
|
2023-06-05 11:37:55 +02:00
|
|
|
|
$passwort, $strasse, $hausnummer, $ort, $plz);
|
2023-05-31 16:03:16 +02:00
|
|
|
|
|
|
|
|
|
|
2023-05-30 19:57:00 +02:00
|
|
|
|
|
|
|
|
|
}
|
2023-05-26 16:39:10 +02:00
|
|
|
|
|
2023-05-30 19:57:00 +02:00
|
|
|
|
}
|
|
|
|
|
?>
|