Sunday, 3 February 2019

Database Project

Login.html:
=====================
<!DOCTYPE html>
<html>
<head>
<title>Login_Page</title>
</head>
<body>
<form method="post" action="connect.php">
UserName:<input type="text" name="username"></br></br>
Password :<input type="password" name="password"></br></br>
<input type="submit" name="" value="Register">
</form>

</body>
</html>


connect.php:
===========================
<?php
$username=filter_input(INPUT_POST, 'username');
$password=filter_input(INPUT_POST,'password');

if ($con=mysqli_connect("localhost","root","","login"))
{

mysqli_query($con,"Insert into account(username,password) values ('$username','$password')");
echo "Connection Sucess and 1 user registred";



}
else
{
echo "Not Connected";
}


?>

No comments:

Post a Comment