Guest User

Untitled

a guest
Apr 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. $host = "localhost";
  2. $user = "root";
  3. $pass = "root";
  4. $db = "user_data";
  5.  
  6. //Create Connection
  7. $conn = new mysqli($host, $user, $pass, $db, 3306);
  8.  
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $FirstName = $_POST["FirstName"];
  15. $LastName = $_POST["LastName"];
  16. $Email = $_POST["Email"];
  17. $Password = $_POST["pass"];
  18.  
  19. $sql = "INSERT INTO sys_users (FirstName, LastName, Email, Password)
  20. VALUES ('$FirstName', '$LastName', '$Email', '$Password')";
  21.  
  22.  
  23. if ($conn->query($sql) === TRUE){
  24. echo "New record created successfully.";
  25. } else {
  26. echo "Error";
  27. }
  28.  
  29. $conn->close();
  30.  
  31. ?>
  32.  
  33. <!DOCTYPE html>
  34. <html lang="en" dir="ltr">
  35. <head>
  36. <meta charset="utf-8">
  37. <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
  38. <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
  39. <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
  40. <script type ='text/javascript' src="p2.js"></script>
  41. <title>Login to Fitness Aide</title>
  42. </head>
  43. <body>
  44. <!-- PAGE 1: LOGIN PAGE -->
  45. <div data-role="page" id="page1">
  46. <div data-role="header">
  47. <h1>Login to Fitness Aide</h1>
  48. </div>
  49. <div data-role="content">
  50. Username: <input type="text" id="user"></input><br>
  51. Password: <input type="password" id="password"></input><br>
  52. <button onclick="submitLogin();">Login</button><br>
  53. <button onclick="signUp();">Sign Up</button><br>
  54. <table>
  55. <tr>
  56. <td><button onclick="addDigit(7);">7</button></td>
  57. <td><button onclick="addDigit(8);">8</button></td>
  58. <td><button onclick="addDigit(9);">9</button></td>
  59. </tr>
  60. <tr>
  61. <td><button onclick="addDigit(4);">4</button></td>
  62. <td><button onclick="addDigit(5);">5</button></td>
  63. <td><button onclick="addDigit(6);">6</button></td>
  64. </tr>
  65. <tr>
  66. <td><button onclick="addDigit(1);">1</button></td>
  67. <td><button onclick="addDigit(2);">2</button></td>
  68. <td><button onclick="addDigit(3);">3</button></td>
  69. </tr>
  70. <tr>
  71. <td><button onclick="addDigit(0);">0</button></td>
  72. </tr>
  73. </table>
  74. <br>
  75. <button onclick="clearPassword();">Clear Password</button> <br>
  76. <div id="txthint"></div>
  77. </div>
  78. </div>
  79.  
  80. <!-- Sign Up Page -->
  81. <div data-role="page" id="page2">
  82. <div data-role="header">
  83. <h1>Sign up for Fitness Aide</h1>
  84. </div>
  85. <div data-role="content">
  86. <form action="p2signUp.php" method="POST">
  87. First Name: <input type="text" id="FirstName"/><br>
  88. Last Name: <input type="text" id="LastName"/><br>
  89. Email: <input type="text" id="Email"/><br>
  90. Password: <input type="password" id="pass"/><br>
  91. <input type="submit" value="Sign Up"/><br>
  92. </form>
  93. </div>
  94. </div>
  95.  
  96. <!-- Exercises -->
  97. <div data-role="page" id="page3">
  98. <div data-role="header">
  99. <h1>Exercises</h1>
  100. </div>
  101. <div data-role="content">
  102. <div id="secret"></div>
  103. </div>
  104. </div>
  105.  
  106. </body>
  107. </html>
Add Comment
Please, Sign In to add comment