Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. <?php
  2.  
  3. if ($_POST) {
  4.  
  5. <?php
  6.  
  7. ob_start();
  8. $host="69.194.233.144"; // Host name
  9. $username="proironc_1"; // Mysql username
  10. $password="muff915"; // Mysql password
  11. $db_name="proironc_login"; // Database name
  12. $tbl_name="members"; // Table name
  13.  
  14.  
  15. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  16. mysql_select_db("$db_name")or die("cannot select DB");
  17.  
  18.  
  19. $myusername=$_POST['myusername'];
  20. $mypassword=$_POST['mypassword'];
  21.  
  22.  
  23. $myusername = stripslashes($myusername);
  24. $mypassword = stripslashes($mypassword);
  25. $myusername = mysql_real_escape_string($myusername);
  26. $mypassword = mysql_real_escape_string($mypassword);
  27. $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
  28. $result=mysql_query($sql);
  29.  
  30.  
  31. $count=mysql_num_rows($result);
  32.  
  33.  
  34. if($count==1){
  35.  
  36.  
  37. session_register("myusername");
  38. session_register("mypassword");
  39. header("location: dashboard.html");
  40. }
  41. else {
  42. echo "";
  43. }
  44. ob_end_flush();
  45. ?>
  46.  
  47. } else {
  48.  
  49. <!doctype html>
  50. <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
  51. <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
  52. <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
  53. <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
  54. <head>
  55.  
  56. <title>Login</title>
  57.  
  58. <meta charset="utf-8" />
  59. <meta name="description" content="" />
  60. <meta name="author" content="" />
  61. <meta name="viewport" content="width=device-width,initial-scale=1" />
  62.  
  63. <link rel="stylesheet" href="./stylesheets/reset.css" type="text/css" media="screen" title="no title" />
  64. <link rel="stylesheet" href="./stylesheets/text.css" type="text/css" media="screen" title="no title" />
  65. <link rel="stylesheet" href="./stylesheets/buttons.css" type="text/css" media="screen" title="no title" />
  66. <link rel="stylesheet" href="./stylesheets/theme-default.css" type="text/css" media="screen" title="no title" />
  67. <link rel="stylesheet" href="./stylesheets/login.css" type="text/css" media="screen" title="no title" />
  68. </head>
  69.  
  70. <body>
  71.  
  72. <div id="login">
  73. <h1>Dashboard</h1>
  74. <div id="login_panel">
  75. <form action="index.php" method="post" accept-charset="utf-8">
  76. <div class="login_fields">
  77. <div class="field">
  78. <label for="email">Username</label>
  79. <input type="text" name="myusername" value="" id="myusername" tabindex="1" placeholder="Username" />
  80. </div>
  81.  
  82. <div class="field">
  83. <label for="password">Password</small></label>
  84. <input type="password" name="mypassword" value="" id="mypassword" tabindex="2" placeholder="Password" />
  85. </div>
  86. </div> <!-- .login_fields -->
  87.  
  88. <div class="login_actions">
  89. <button type="submit" class="btn btn-primary" tabindex="3">Login</button>
  90. </div>
  91. </form>
  92. </div> <!-- #login_panel -->
  93. </div> <!-- #login -->
  94.  
  95. <script src="javascripts/all.js"></script>
  96.  
  97.  
  98. </body>
  99. </html>
  100.  
  101. }
  102.  
  103. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement