Email me forms login
Here is an example of a simple login form in HTML and CSS:
HTML:
<form action="/login" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"><br><br>
<input type="submit" value="Login">
</form>
CSS:
form {
width: 300px;
margin: 0 auto;
text-align: center;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
width: 100%;
height: 30px;
margin-bottom: 20px;
padding: 10px;
border: 1px solid #ccc;
}
input[type="submit"] {
width: 100%;
height: 40px;
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
This is just a basic example, and you will need to add more functionality to your login form, such as validating user input and authenticating the user. You will also need to create a backend script to handle the login request and verify the user's credentials.
Here is an example of a simple login script in PHP:
<?php
// Check if the user has submitted the form
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the username and password from the form
$username = $_POST["username"];
$password = $_POST["password"];
// Check if the username and password are valid
if ($username == "admin" && $password == "password") {
// Login successful, redirect to a secure page
header("Location: secure.php");
exit;
} else {
// Login failed, display an error message
echo "Invalid username or password";
}
}
?>
This script checks if the user has submitted the form, and then checks if the username and password are valid. If they are, it redirects the user to a secure page. If not, it displays an error message.
Please note that this is a very basic example and you should never store passwords in plain text. You should always hash and salt your passwords before storing them in your database.