You are on page 1of 4

Practical 10

inside Sign-in.html
<html>
<head>
<title>Sign-In</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body id="body-color">
<div id="Sign-In">
<fieldset style="width:30%"><legend>LOG-IN HERE</legend>
<h1> WELCOME TO YASH's PAGE </h1>
<form method="POST" action="connectivity.php">
User <br><input type="text" name="user" size="40"><br>
<input id="button" type="submit" name="submit" value="Log-In">
</form>
</fieldset>
</div>
</body>
</html>

inside connectivity.php
<?php
$servername = "localhost";
$username = "root";
$password = "root";

// Create connection
$conn = new mysqli($servername, $username, $password,”sgn”);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";

$username = trim($_POST["user"]);
echo "\nyour name is :- $username";
$sql = "INSERT INTO user VALUES ('$username')";
?>
inside style.css
#body-color
{
background-color:#ff8080;
}
#Sign-In
{
margin-top:150px;
margin-bottom:150px;
margin-right:150px;
margin-left:450px;
border:3px solid #a1a1a1;
padding:9px 35px;
background:#808080;
width:400px;
border-radius:20px;
box-shadow: 7px 7px 6px;
}
#button
{
border-radius:10px;
width:100px;
height:40px;
background:#00FF00;
font-weight:bold;
font-size:20px
}
output:-

You might also like