-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg.php
30 lines (26 loc) · 877 Bytes
/
reg.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
<?php
require_once "lib/lib.php";
require_once "lib/config.php";
require_once "lib/auth.php";
$name = secure_variable_post("name");
$login = secure_variable_post("login");
$password = secure_variable_post("password");
$title = "Join $site_name";
if (login()) {
die ("<script language=javascript>location.replace('index.php');</script>");
}
if (isset($_POST['register'])) {
if (regdata_valid() && pass_valid()) {
$salt = mt_rand(100000, 999999);
$pass_md5 = md5(md5($password) . $salt);
mysqli_query($ml, "INSERT INTO users (u_login,u_pass,u_salt,u_name,u_regtime)
VALUES ('$login','$pass_md5','$salt','$name',NOW())");
echo mysqli_error($ml);
enter();
die ("<script language=javascript>location.replace('index.php');</script>");
}
}
include "template/menu.php";
include "template/registration.php";
include "template/footer.php";
?>