Demo entry 6631061

fasfasf

   

Submitted by anonymous on Jul 12, 2017 at 15:11
Language: HTML+PHP. Code size: 2.2 kB.

<?php

if (substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.') {
    header('Location: http://www.'.$_SERVER['HTTP_HOST'].'/');
    exit;
}

session_start();

require 'includes/db.php';

$success = "";

if(isset($_POST['submit'])){



$user = "techm";
$pass = "400419026cd213778406498dcbfcf53c";

$username = strtolower(mysqli_real_escape_string($con,$_POST['username']));
$password = mysqli_real_escape_string($con,$_POST['password']);


if ( $user != $username ){ 
   
    $success = "Username doesn't exist!";

}else{ 

    if ( $pass==md5($password) ) {
        
        
        $_SESSION['logged_in'] = true;

        header("location: http://www.graphboardstm.com/companies.php");
        
    }
    else {
        $success = "You have entered wrong password, try again!";
    
    }
}

}

?>

    <?php

require 'includes/vendors.php';

?>
        </head>

        <body>
            <div class="bg-img">

                <div class="container">
                    <div class="row">
                        <div class="col-md-4"></div>
                        <div class="col-md-4">
                            <div class="form-wrapper">
                                <form class="form-signin" method="POST">
                                    <img class="form-signin-heading" src="./assets/TechMLogo.png" height="100px" width="100%">

                                    <input type="text" class="form-control loginpad" name="username" placeholder="Username" required="" autofocus="" />
                                    <input type="password" class="form-control" name="password" placeholder="Password" required="" />
                                    <button class="btn btn-lg btn-new btn-block btn-padding" name="submit" type="submit">Login</button>
                                    <?php echo $success; ?>
                                </form>

                            </div>

                        </div>
                        <div class="col-md-4"></div>
                    </div>
                </div>
            </div>
        </body>

        </html>

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).