Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host = "localhost";
- $user = "root";
- $pass = "root";
- $db = "user_data";
- //Create Connection
- $conn = new mysqli($host, $user, $pass, $db, 3306);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $FirstName = $_POST["FirstName"];
- $LastName = $_POST["LastName"];
- $Email = $_POST["Email"];
- $Password = $_POST["pass"];
- $sql = "INSERT INTO sys_users (FirstName, LastName, Email, Password)
- VALUES ('$FirstName', '$LastName', '$Email', '$Password')";
- if ($conn->query($sql) === TRUE){
- echo "New record created successfully.";
- } else {
- echo "Error";
- }
- $conn->close();
- ?>
- <!DOCTYPE html>
- <html lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
- <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
- <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
- <script type ='text/javascript' src="p2.js"></script>
- <title>Login to Fitness Aide</title>
- </head>
- <body>
- <!-- PAGE 1: LOGIN PAGE -->
- <div data-role="page" id="page1">
- <div data-role="header">
- <h1>Login to Fitness Aide</h1>
- </div>
- <div data-role="content">
- Username: <input type="text" id="user"></input><br>
- Password: <input type="password" id="password"></input><br>
- <button onclick="submitLogin();">Login</button><br>
- <button onclick="signUp();">Sign Up</button><br>
- <table>
- <tr>
- <td><button onclick="addDigit(7);">7</button></td>
- <td><button onclick="addDigit(8);">8</button></td>
- <td><button onclick="addDigit(9);">9</button></td>
- </tr>
- <tr>
- <td><button onclick="addDigit(4);">4</button></td>
- <td><button onclick="addDigit(5);">5</button></td>
- <td><button onclick="addDigit(6);">6</button></td>
- </tr>
- <tr>
- <td><button onclick="addDigit(1);">1</button></td>
- <td><button onclick="addDigit(2);">2</button></td>
- <td><button onclick="addDigit(3);">3</button></td>
- </tr>
- <tr>
- <td><button onclick="addDigit(0);">0</button></td>
- </tr>
- </table>
- <br>
- <button onclick="clearPassword();">Clear Password</button> <br>
- <div id="txthint"></div>
- </div>
- </div>
- <!-- Sign Up Page -->
- <div data-role="page" id="page2">
- <div data-role="header">
- <h1>Sign up for Fitness Aide</h1>
- </div>
- <div data-role="content">
- <form action="p2signUp.php" method="POST">
- First Name: <input type="text" id="FirstName"/><br>
- Last Name: <input type="text" id="LastName"/><br>
- Email: <input type="text" id="Email"/><br>
- Password: <input type="password" id="pass"/><br>
- <input type="submit" value="Sign Up"/><br>
- </form>
- </div>
- </div>
- <!-- Exercises -->
- <div data-role="page" id="page3">
- <div data-role="header">
- <h1>Exercises</h1>
- </div>
- <div data-role="content">
- <div id="secret"></div>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment