Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. <?php
  2. require 'rb.php';
  3. R::setup();
  4. function createUser($name, $password)
  5. {
  6. $user = R::dispense('users');
  7. $user->name = htmlentities(htmlspecialchars($name));
  8. $user->password = htmlentities(htmlspecialchars($password));
  9. $user->isAdmin = false;
  10. $id = R::store($user);
  11. return $id;
  12. }
  13.  
  14. function login($userName, $passWord)
  15. {
  16.  
  17. }
  18.  
  19. if(isset($_POST['SMT']))
  20. {
  21. $name = $_REQUEST['name'];
  22. $password = $_REQUEST['password'];
  23. echo createUser($name,$password);
  24. }
  25.  
  26. ?>
  27.  
  28. <!DOCTYPE html>
  29. <html lang="en">
  30. <head>
  31. <meta charset="utf-8">
  32. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  33. <meta name="viewport" content="width=device-width, initial-scale=1">
  34. <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  35. <title>Bootstrap 101 Template</title>
  36.  
  37. <!-- Bootstrap -->
  38. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  39.  
  40. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  41. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  42. <!--[if lt IE 9]>
  43. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  44. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  45. <![endif]-->
  46. </head>
  47. <body>
  48. <div class="container center-block">
  49.  
  50.  
  51. <h1>Login </h1>
  52. <div class="well ">
  53. <form action="" method="post">
  54. <input class ="form-control" type="text" name="name" placeholder="UserName" />
  55. <input class ="form-control" type="password" name="password" placeholder="Password" />
  56. <button class="btn btn-lg btn-default pull-right" type="submit" name="SMT">Login!</button>
  57. <br>
  58. <br>
  59. </form>
  60. </div>
  61. </div>
  62.  
  63. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  64. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  65. <!-- Include all compiled plugins (below), or include individual files as needed -->
  66. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  67. </body>
  68. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement