Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!empty($_SESSION["authid"])){
- echo "<script>location.href='index.php'</script>";
- }
- include "./config/db.php";
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Cpanel Login</title>
- <style>
- * {
- margin:0 auto;
- padding:0;
- }
- body {
- background:url(img/skulls.png);
- }
- #layout {
- margin-top:240px;
- width:500px;
- padding:5px;
- background:url(img/green_cup.png);
- padding:20px;
- border-radius:5px;
- -webkit-box-shadow:0 1px 3px #000;
- -moz-box-shadow:0 1px 3px #000;
- box-shadow:0 1px 3px #000;
- }
- #login {
- float:left;
- border-right:1px dotted #DDD;
- padding-right:3px;
- }
- #login_footer {
- clear:both;
- }
- #right {
- float:right;
- }
- .msg {
- width:250px;
- background-color:#FFDFDF;
- border-radius:0 0 10px 10px;
- color:#666;
- text-align:center;
- border:1px solid #FFB9B9;
- -webkit-box-shadow:0 1px 3px #919191;
- -moz-box-shadow:0 1px 3px #919191;
- box-shadow:0 1px 3px #919191;
- font-family:Verdana, Geneva, sans-serif;
- font-size:10px;
- padding:10px;
- }
- .input_user {
- border:1px solid #DDD;
- -webkit-box-shadow:0 1px 3px #919191;
- -moz-box-shadow:0 1px 3px #919191;
- box-shadow:0 1px 3px #919191;
- padding:6px;
- margin:1px;
- color:#666;
- font-style:italic;
- width:150px;
- }
- .input_user:hover {
- background-color:#F8F8F8;
- }
- .input_pass {
- border:1px solid #DDD;
- -webkit-box-shadow:0 1px 3px #919191;
- -moz-box-shadow:0 1px 3px #919191;
- box-shadow:0 1px 3px #919191;
- padding:6px;
- margin:1px;
- color:#666;
- font-style:italic;
- width:150px;
- margin-left:50px;
- }
- .input_pass:hover {
- background-color:#F8F8F8;
- }
- .button {
- margin-top:3px;
- background-image:-moz-linear-gradient(-90deg,#FFF,#F3F3F3);
- background-image:-webkit-linear-gradient(-90deg,#FFF,#F3F3F3);
- border:1px solid #DDD;
- font-size:11px;
- color: #666;
- padding:5px;
- -webkit-box-shadow:0 1px 3px #919191;
- -moz-box-shadow:0 1px 3px #919191;
- box-shadow:0 1px 3px #919191;
- border-radius:.3em;
- cursor:pointer;
- margin-right:2px;
- margin-bottom:5px;
- }
- .button:hover {
- background-image:-moz-linear-gradient(-90deg,#F3F3F3,#FFF);
- background-image:-webkit-linear-gradient(-90deg,#F3F3F3,#FFF);
- }
- #button {
- margin-left:90px;
- }
- </style>
- </head>
- <body>
- <div id="layout">
- <div id="login">
- <form method="post" action="">
- <table>
- <tr><td><input type="text" name="username" class="input_user" /></td></tr>
- <tr><td><input type="password" name="password" class="input_pass" /></td></tr>
- <tr><td><span id="button"><input type="submit" value="Login" class="button" name="btn_login" /><input type="button" value="Cancel" onclick="self.history.back()" class="button" /></span>
- </td></tr>
- </table>
- </form>
- <?php
- if(isset($_POST["btn_login"])){
- if(empty($_POST["username"])||empty($_POST["password"])){
- NULL;
- }else{
- $pass = md5($_POST["password"]);
- $sql = mysql_query("SELECT * FROM tbl_admin WHERE username = '$_POST[username]' AND password = '$pass'");
- $check = mysql_num_rows($sql);
- $r = mysql_fetch_array($sql);
- if($check < 1){
- NULL;
- }else{
- session_register("authid");
- $_SESSION["authid"] = $r['id_admin'];
- echo "<script>location.href='index.php'</script>";
- }
- }
- }
- ?>
- </div>
- <div id="right">
- <div class="msg">
- Welcome admin :)<br />
- Input your username and password to login to your system!
- </div>
- </div>
- <div id="login_footer"></div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement