jun 20
This commit is contained in:
@@ -6,7 +6,7 @@ if (!loggedin()) {
|
||||
if (
|
||||
isset($_POST['name']) && isset($_POST['surname']) && isset($_POST['email'])
|
||||
&& isset($_POST['password']) && isset($_POST['password_again']) && isset($_POST['birth_day'])
|
||||
&& isset($_POST['birth_month']) && isset($_POST['birth_year'])
|
||||
&& isset($_POST['birth_month']) && isset($_POST['birth_year']) && isset($_POST['city'])
|
||||
) {
|
||||
$name = $_POST['name'];
|
||||
$surname = $_POST['surname'];
|
||||
@@ -17,10 +17,11 @@ if (!loggedin()) {
|
||||
$birth_day = $_POST['birth_day'];
|
||||
$birth_month = $_POST['birth_month'];
|
||||
$birth_year = $_POST['birth_year'];
|
||||
$city = $_POST['city'];
|
||||
|
||||
if (
|
||||
!empty($name) && !empty($password) && !empty($password_again) &&
|
||||
!empty($email) && !empty($birth_day) && !empty($birth_month) && !empty($birth_year)
|
||||
!empty($email) && !empty($birth_day) && !empty($birth_month) && !empty($birth_year) && !empty($city)
|
||||
) {
|
||||
if (strlen($name) > 30) {
|
||||
echo 'Please ahear to maxlength of fields';
|
||||
@@ -46,11 +47,11 @@ if (!loggedin()) {
|
||||
echo 'The email ' . $email . 'already exists';
|
||||
} else {
|
||||
$query = "INSERT INTO `globaly_accounts` VALUES (NULL ,'" . mysqli_real_escape_string($con, $name) .
|
||||
"','" . mysqli_real_escape_string($con, $surname) ."','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "','" .
|
||||
"','" . mysqli_real_escape_string($con, $surname) ."','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "','" . mysqli_real_escape_string($con, $city) ."','" .
|
||||
mysqli_real_escape_string($con, $birth_day) . "','" . mysqli_real_escape_string($con, $birth_month) . "','" . mysqli_real_escape_string($con, $birth_year) . "')";
|
||||
if ($query_run = mysqli_query($con, $query)) {
|
||||
echo '<script>alert("You are registerd!")</script>';
|
||||
header('Location: ../index.html');
|
||||
header('Location: ../index.php');
|
||||
} else {
|
||||
echo 'We could not register you!';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user