Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Problem 2</title>
- <style>
- input{
- margin-top: 2%;
- display: inline-block;
- }
- fieldset{
- /*For Firefox:*/
- background: -moz-linear-gradient(rgba(255,254,163,0.76), rgba(215,65,136,0.76));
- /*For Safari:*/
- background: -webkit-linear-gradient(rgba(255,254,163,0.76), rgba(215,65,136,0.76));
- /*For Opera:*/
- background: -o-linear-gradient(rgba(255,254,163,0.76), rgba(215,65,136,0.76));
- /*Standard syntax:*/
- background: linear-gradient(rgba(255,254,163,0.76), rgba(215,65,136,0.76));
- width: 50%;
- }
- .container{
- width: 500px;
- clear: both;
- }
- .input{
- width: 100%;
- clear: both;
- }
- </style>
- <script type="text/javascript">
- function describe() {
- document.getElementById("name").innerHTML = "you";
- }
- </script>
- </head>
- <body>
- <fieldset>
- <h2>Login</h2>
- <div class="container">
- <form method="post">
- Username:
- <input class = "input" type="text" name="username" size="50" alt="you" id = "name" onmouseover="describe()">
- <br>
- Password:
- <input class = "input"type="password" name="password" size="50">
- <br>
- Confirm password:
- <input class = "input" type="password" name="confirmPassword" size="50">
- <input type="submit" id = "color" style = "background-color: red" name="submit" value="submit">
- </form>
- </div>
- <?php
- $username = "";
- $password = "";
- $confirmPass = "";
- if(isset($_POST['submit'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $confirmPass = $_POST['confirmPassword'];
- if(($username == null) || ($password == null)){
- echo "PLEASE VALIDATE YOURSELF!";
- }
- elseif($password !== $confirmPass){
- echo "Please retype your password correctly!";
- }
- else{
- echo "Greetings " . $username . "! Your encrypted password is: " . crypt($password, CRYPT_SALT_LENGTH);
- }
- }
- ?>
- </fieldset>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement