-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_process.php
38 lines (38 loc) · 920 Bytes
/
login_process.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
include("./functions.php");
session_start();
if ($_POST["mail"])
{
if (preg_match("/.+\@.+\..+/", $_POST["lname"]))
{
$_SESSION["alert"] = "Wrong mail";
header("Location: ./index.php");
die();
}
$_SESSION["mail"] = $_POST["mail"];
if (preg_match("/.*[\.\\/\"\'\!\?\>\<\=\*\$\%\|\&\(\)\]\[\}\{\~\`\_\*\#\+\=].*/", $_POST["pass"]))
{
$_SESSION["alert"] = "Wrong pass";
header("Location: ./index.php");
die();
}
if (strlen($_POST["pass"]) < 5)
{
$_SESSION["alert"] = "Passwd len";
header("Location: ./index.php");
die();
}
if (index_sql($_POST["mail"], my_crypt($_POST["pass"], $_POST["mail"])))
{
header("Location: ./index.php");
die();
}
unset($_SESSION["gender"], $_SESSION["mail"], $_SESSION["lname"], $_SESSION["fname"]);
$_SESSION["alert"] = "SQL error";
header("Location: ./index.php");
die();
}
$_SESSION["alert"] = "No mail";
header("Location: ./index.php");
die();
?>