Guest User

Untitled

a guest
Nov 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. <?php
  2. include 'connection.php';
  3. if(isset($_POST['submit']))
  4. {
  5. echo"sucee";
  6. $firstname = $_POST['firstname'];
  7. $lastname = $_POST['lastname'];
  8. $email = $_POST['email'];
  9. $password = $_POST['password'];
  10. $gender = $_POST['gender'];
  11. $age = $_POST['age'];
  12. }
  13.  
  14. $sql = "INSERT INTO user (FirstName,LastName,Email,Password,Gender,Age) VALUES ('$firstname', '$lastname', '$email', '$password', '$gender', '$age')";
  15.  
  16.  
  17. $result=mysqli_query($connection, $sql);
  18. include 'watWK6.php';
  19. include 'selectRecord.php';
  20.  
  21.  
  22. ?>
  23.  
  24. <?php
  25. $hostname = 'localhost';
  26. $username = 'root';
  27. $password = '';
  28. $databaseName = 'c7181378';
  29. $connection = mysqli_connect($hostname, $username, $password, $databaseName) or exit("Unable to connect to database!");
  30. ?>
  31.  
  32. <!DOCTYPE html>
  33. <html lang="en">
  34. <head>
  35. <title>Web Applications and Technologies</title>
  36. <link type="text/css" rel="stylesheet" href="main.css" />
  37. </head>
  38. <body>
  39. <header>
  40. <h1> C7181378</h1>
  41. </header>
  42.  
  43. <section id="container">
  44. <form method = "POST" action = "insertRecord.php">
  45. <fieldset>
  46. <legend> Enter Customer Details </legend>
  47. <label> First Name: </label>
  48. <input type = "text" name = "firstname"/>
  49. <br/>
  50. <label> Surname: </label>
  51. <input type = "text" name = "lastname"/>
  52. <br/>
  53. <label> Email: </label>
  54. <input type = "text" name = "email"/>
  55. <br/>
  56. <label> Password: </label>
  57. <input type = "password" name = "password"/>
  58. <br/>
  59. <label> Gender: </label>
  60. <select name = "gender">
  61. <option value = "M"> Male </option>
  62. <option value = "F"> Female </option>
  63. </select>
  64. <br/>
  65. <label> Age: </label>
  66. <input type = "text" name = "age"/>
  67. <br/>
  68. <input type = "submit" value = "submit" name = "submit"/>
  69. </fieldset>
  70. </form>
  71. </section>
  72. <footer>
  73. <small> <a href="../index.html">Home</a></small>
  74. </footer>
  75. </body>
  76. </html>
  77.  
  78. <?php
  79. include 'selectRecord.php';
  80. ?>
Add Comment
Please, Sign In to add comment