Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. Login.html
  2.  
  3. //bob - look at lines 24-34 and 41-42
  4. //just some small things
  5.  
  6. <html>
  7. <head>
  8. <style type="text/css">
  9. body
  10. {
  11. background-color:#b0c4de;
  12. margin-top:100px;
  13. margin-bottom:100px;
  14. margin-right:50px;
  15. margin-left:50px;
  16. border-style:solid;
  17. border-width:3px;
  18. border-style:solid;
  19. border-width:1px;
  20. }
  21. </style>
  22. </head>
  23.  
  24.  
  25. <?php
  26. //prints out some erros
  27. if (!empty($errors)) {
  28.     echo '<h1>error!</h1>
  29.     <p class="error">the following error(s) occurred:br />';
  30.     foreach ($error as $msg){
  31.     echo " - $msg<br />\n";
  32.     }
  33.     echo '</p><p>Please try again.</p>';
  34. }
  35. ?>
  36.  
  37.  
  38. <body>
  39. <h1>Login</h1>
  40.  
  41. <form action="login.php" method="post">
  42. Name: <input type="text" name="username" size="20" maxlength="20" />
  43. Name: <input type="text" name="password" size="20" maxlength="20"/>
  44. <input type="submit" value="Login" />
  45. </form>
  46.  
  47.  
  48.  
  49. </html>
  50.  
  51. login.php
  52.  
  53. <?php
  54. $con = mysql_connect("*****","*****","*******");
  55. if (!$con)
  56. {
  57. die('Could not connect: ' . mysql_error());
  58. }
  59.  
  60. mysql_select_db("******", $con);
  61.  
  62. $select_user =
  63. mysql_query('select * from users where username = "' . $_POST['username'] . '" and password = "' . md5($_POST['password'] . '"'));
  64.  
  65. if ($select_user.mysql_num_rows > 0){
  66. session_start();
  67. }else{
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement