i have here a problem with a php signup script... It says that it is successfull but when i look into my database i dont see any data in there can you help me out? Here is the php code:
<?php
if(isset($_POST['submit'])){
include_once("db.php");
$first = $_POST['meno'];
$last = $_POST['priezvisko'];
$email = $_POST['email'];
$uid = $_POST['username'];
$pwd = $_POST['heslo'];
$age = $_POST['vek'];
if(empty($first) OR empty($last) OR empty($email) OR empty($uid) OR empty($pwd) OR empty($age)){
header("Location: ../signup.php?signup=empty");
exit();
}elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
//Check email
header("Location: ../signup.php?signup=emailnotvalid");
exit();
}else{
$query = mysqli_query($conn, "SELECT * FROM users WHERE user_uid='$uid'");
$resultCheck = mysqli_num_rows($query);
if($resultCheck > 0){
header("Location: ../signup.php?usernametaken");
exit();
}else{
$hashedPwd = password_hash($pwd, PASSWORD_DEFAULT);
$query = mysqli_query($conn, "INSERT INTO users(user_first,user_last,user_email,user_uid,user_pwd,user_date, user_level,user_age) VALUES('$first', '$last','$email','$email','$hashedPwd', NOW(), 0,'$age')");
header("Location: ../signup.php?signup=success");
}
}
}
?>