0% found this document useful (0 votes)
82 views

Practical - 10 PDF

The document contains code for a sign-in web page. It includes HTML code for the front-end sign-in form, PHP code to connect to a database and insert form data, and CSS code to style page elements like colors, borders, and buttons. The HTML defines a sign-in form with fields for username, a submit button, and links to the style sheet and PHP code. The PHP code connects to a MySQL database, gets the username from the POST request, echoes it, and inserts it into the users table. The CSS styles the page background color, positions and styles the sign-in form div, and formats the submit button.

Uploaded by

YASH MODI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Practical - 10 PDF

The document contains code for a sign-in web page. It includes HTML code for the front-end sign-in form, PHP code to connect to a database and insert form data, and CSS code to style page elements like colors, borders, and buttons. The HTML defines a sign-in form with fields for username, a submit button, and links to the style sheet and PHP code. The PHP code connects to a MySQL database, gets the username from the POST request, echoes it, and inserts it into the users table. The CSS styles the page background color, positions and styles the sign-in form div, and formats the submit button.

Uploaded by

YASH MODI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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