Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST) {
- <?php
- ob_start();
- $host="69.194.233.144"; // Host name
- $username="proironc_1"; // Mysql username
- $password="muff915"; // Mysql password
- $db_name="proironc_login"; // Database name
- $tbl_name="members"; // Table name
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $myusername=$_POST['myusername'];
- $mypassword=$_POST['mypassword'];
- $myusername = stripslashes($myusername);
- $mypassword = stripslashes($mypassword);
- $myusername = mysql_real_escape_string($myusername);
- $mypassword = mysql_real_escape_string($mypassword);
- $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- if($count==1){
- session_register("myusername");
- session_register("mypassword");
- header("location: dashboard.html");
- }
- else {
- echo "";
- }
- ob_end_flush();
- ?>
- } else {
- <!doctype html>
- <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
- <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
- <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
- <head>
- <title>Login</title>
- <meta charset="utf-8" />
- <meta name="description" content="" />
- <meta name="author" content="" />
- <meta name="viewport" content="width=device-width,initial-scale=1" />
- <link rel="stylesheet" href="./stylesheets/reset.css" type="text/css" media="screen" title="no title" />
- <link rel="stylesheet" href="./stylesheets/text.css" type="text/css" media="screen" title="no title" />
- <link rel="stylesheet" href="./stylesheets/buttons.css" type="text/css" media="screen" title="no title" />
- <link rel="stylesheet" href="./stylesheets/theme-default.css" type="text/css" media="screen" title="no title" />
- <link rel="stylesheet" href="./stylesheets/login.css" type="text/css" media="screen" title="no title" />
- </head>
- <body>
- <div id="login">
- <h1>Dashboard</h1>
- <div id="login_panel">
- <form action="index.php" method="post" accept-charset="utf-8">
- <div class="login_fields">
- <div class="field">
- <label for="email">Username</label>
- <input type="text" name="myusername" value="" id="myusername" tabindex="1" placeholder="Username" />
- </div>
- <div class="field">
- <label for="password">Password</small></label>
- <input type="password" name="mypassword" value="" id="mypassword" tabindex="2" placeholder="Password" />
- </div>
- </div> <!-- .login_fields -->
- <div class="login_actions">
- <button type="submit" class="btn btn-primary" tabindex="3">Login</button>
- </div>
- </form>
- </div> <!-- #login_panel -->
- </div> <!-- #login -->
- <script src="javascripts/all.js"></script>
- </body>
- </html>
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement