Rated an average of 0 stars by 0 people

Login

Script Details:
Added on March 23, 2017 by ilyassrekik.
ilyassrekik accreditted the script to "HELLO."

Description:
LOGIN SCRIPT

Tags: login, php

Code:

<?php
# Snippet from PHP Share: http://www.phpshare.org

/** * @author Xuong * @copyright 2016
*/
$isLogin false;
$message '';

if (isset(
$_POST['username']) && isset($_POST['password']))
{
    if (
$_POST['username'] === 'xuong' && $_POST['xuong'
       ] === '123456')
    {
        
$isLogin true;
    }
    else
    {
        
$message 'User name or password is incorrect !';
    }
}

?>

<html>
    <head>
        <title>Login</title>
        <style>
            *{font-size: 14px; color: dimgray; margin: 0; padding: 0}
            .contain {
                width: 100%;
            }
            .wp-contain{
                    padding: 20px;
            }
            .form {
                    width: 320px;
                    margin: 0 auto;
                    background: #F3F3F3;
                    border-radius: 5px;
                    box-shadow: 1px 1px 6px 1px darkgrey;
                    border: 2px dashed #B6D8FF;
                background: rgba(73,155,234,1);
                background: -moz-linear-gradient(left, rgba(73,155,234,1) 0%, rgba(32,124,229,1) 100%);
                background: -webkit-gradient(left top, right top, color-stop(0%, rgba(73,155,234,1)), color-stop(100%, rgba(32,124,229,1)));
                background: -webkit-linear-gradient(left, rgba(73,155,234,1) 0%, rgba(32,124,229,1) 100%);
                background: -o-linear-gradient(left, rgba(73,155,234,1) 0%, rgba(32,124,229,1) 100%);
                background: -ms-linear-gradient(left, rgba(73,155,234,1) 0%, rgba(32,124,229,1) 100%);
                background: linear-gradient(to right, rgba(73,155,234,1) 0%, rgba(32,124,229,1) 100%);
                filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#499bea', endColorstr='#207ce5', GradientType=1 );
            }
            
            .wp-form{
                padding: 30px 20px;
            }
            
            .error{
                color: white;
                margin-bottom: 5px;
            }
            
            
            .component{
                margin-bottom: 10px;
            }
            .component > input{
                padding: 7px;
                border: 1px solid #51A3FF;
                border-radius: 4px;
                width: 100%;
            }
            
            .component > button{
                padding: 7px;
                width: 150px;
                color: white;
                background: #151579;
                border: 1px solid #5399E6;
                border-radius: 8px;
                cursor: pointer;
            }
            
            .center{
                text-align: center;
            }
            
            .title{
                    text-align: center;
                    color: white;
                    padding: 8px 0;
                    font-size: 24px;
                    margin-top: -15px;
                    margin-bottom: 10px;
            }
            .message{
                    text-align: center;
    font-size: 24px;
    padding: 20px;
            }
        </style>
    </head>
    <body>
        <div class="contain">
            <div class="wp-contain">
                <?php
# Snippet from PHP Share: http://www.phpshare.org

if ($isLogin)
{
    
?>
                <div class="message">
                    Log-in is successful !
                </div>
                <?php
# Snippet from PHP Share: http://www.phpshare.org

}
else
{
    
?>
                <form method="post" action="">
                    <div class="form">
                        <div class="wp-form">
                            
                        <div class="title">
                            LOG IN 
                            </div>
                        <div class="error">
                            <?php
# Snippet from PHP Share: http://www.phpshare.org

echo $message?>
                        </div>
                        <div class="component">
                            <input type="text" name="username" placeholder="User name">
                        </div>
                        <div class="component">
                            <input type="password" name="password" placeholder="Password">
                        </div>
                        <div class="component center">
                            <button>
                                Submit
                            </button>
                        </div>
                            
                            </div>
                    </div>
                </form>
                <?php
# Snippet from PHP Share: http://www.phpshare.org

}

?>
            </div>
        </div>
    </body>
</html>
?>

Review this PHP Script:

Rating:

Comments:


Login

User:
Pass:

Register

Not a member? Register today and receive the many free benefits of being a member!

Advertisements