Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'rb.php';
- R::setup();
- function createUser($name, $password)
- {
- $user = R::dispense('users');
- $user->name = htmlentities(htmlspecialchars($name));
- $user->password = htmlentities(htmlspecialchars($password));
- $user->isAdmin = false;
- $id = R::store($user);
- return $id;
- }
- function login($userName, $passWord)
- {
- }
- if(isset($_POST['SMT']))
- {
- $name = $_REQUEST['name'];
- $password = $_REQUEST['password'];
- echo createUser($name,$password);
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
- <title>Bootstrap 101 Template</title>
- <!-- Bootstrap -->
- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <div class="container center-block">
- <h1>Login </h1>
- <div class="well ">
- <form action="" method="post">
- <input class ="form-control" type="text" name="name" placeholder="UserName" />
- <input class ="form-control" type="password" name="password" placeholder="Password" />
- <button class="btn btn-lg btn-default pull-right" type="submit" name="SMT">Login!</button>
- <br>
- <br>
- </form>
- </div>
- </div>
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <!-- Include all compiled plugins (below), or include individual files as needed -->
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement