Can you fix this PHP file please to the following:
1- the login will be the same just make the user can input email or username.
2- in registration part can you include the username and confirm a password.
Here is the code:
Survey System
body, html{ height: 100%; background-repeat: no-repeat; background-color: #d3d3d3; font-family: 'Oxygen', sans-serif; }
.main{ margin-top: 70px; }
h1.title { font-size: 50px; font-family: 'Passion One', cursive; font-weight: 400; }
hr{ width: 10%; color: #fff; }
.form-group{ margin-bottom: 15px; }
label{ margin-bottom: 15px; }
input, input::-webkit-input-placeholder { font-size: 11px; padding-top: 3px; }
.main-login{ background-color: #fff; /* shadows and rounded borders */ -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
.main-center{ margin-top: 30px; margin: 0 auto; max-width: 330px; padding: 40px 40px;
}
.login-button{ margin-top: 5px; }
.login-register{ font-size: 11px; text-align: center; }
html, body { margin:0; padding:0; height:100%; } #wrapper { min-height:100%; position:relative; }
#content { padding-bottom:100px; /* Height of the footer element */ } #footer { width:100%; position:absolute; bottom:0; left:0; }
Login
validation($_POST['username']); $email = $fm->validation($_POST['email']); $password = $fm->validation($_POST['password']); $username = mysqli_real_escape_string($db->link,$username); $email = mysqli_real_escape_string($db->link,$email); $password = mysqli_real_escape_string($db->link,$password);
if($email=='admin@admin.com' && $password=='1111'){ Session::set("adminsession","admin@admin.com"); echo ""; exit; }
$query = "SELECT * FROM username WHERE Email = '$email'"; $result = $db->select($query); if($result!= false){
$value = $result->fetch_assoc(); $dbpassword = $value['Password']; if(password_verify($password, $dbpassword)){ Session::set("login",true); Session::set("email",$value['Email']); Session::set("userId",$value['Username_ID']); echo ""; }else{ echo "Email and Password do not matched !!! "; } }else{ } } ?>