Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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{ } } ?>

Register

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Consistently develop management talent.

Answered: 1 week ago

Question

Create a refreshed and common vision and values across Europe.

Answered: 1 week ago

Question

Provide the best employee relations environment.

Answered: 1 week ago