Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to make changes to the java script code I need to make a conform pasword feild here is the JS code var myInput

I need to make changes to the java script code I need to make a conform pasword feild

here is the JS code

This is the php code;

$username = "root";

$password = "";

$hostname = "localhost";

$dbname = "lab";

$selected = mysqli_connect($hostname, $username, $password, $dbname);

if(isset($_POST['user']) && isset($_POST['pass'])){

$user = $_POST['user'];

$pass = $_POST['pass'];

$query = "SELECT * FROM users WHERE username='$user'";

$result = mysqli_query($selected, $query);

if(mysqli_num_rows($result) > 0 ) { //check if there is already an entry for that username

echo "Username already exists!";

}else{

$query = "INSERT INTO users (username, password) VALUES ('$user', '$pass')";

$result = mysqli_query($selected, $query);

header("location:index.php");

}

}

mysqli_close($selected);

?>

Signup!

" method="POST">

Username:

Password:

Here is the SQL

CREATE TABLE IF NOT EXISTS users(

id int(11) NOT NULL AUTO_INCREMENT,

username varchar(50) NOT NULL,

password varchar(255) NOT NULL,

created_at datetime DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (id),

UNIQUE KEY username(username)

) ;

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

Step: 3

blur-text-image

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

What are the goals of Multicultural Education?

Answered: 1 week ago