Guest User

Untitled

a guest
May 7th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. user registrtation html code:
  2. <html>
  3. <head>
  4. <title>user registration</title>
  5. </head>
  6. <body>
  7. <h2 align="center">User Registration Form</h2>
  8. <form name="form" method="post" action="xyz.php" enctype="multipart/form-data" align="center">
  9. NAME:&nbsp;&nbsp;
  10. <input type="text" name="name" size="25" maxlength="25"><br><br>
  11. ADDRESS:<br>
  12. <textarea name="address" cols="25" rows="4"> </textarea><br><br>
  13. Date of Birth:<br>
  14. <select name=birth_month><br>
  15. <option selected value=1>January
  16. <option value=2> February
  17. <option value=3>March
  18. <option value=4>April
  19. <option value=5>May
  20. <option value=6>June
  21. <option value=7>July
  22. <option value=8>August
  23. <option value=9>September
  24. <option value=10>October
  25. <option value=11>November
  26. <option value=12>December
  27. </select>
  28. <select name=birth_day><br>
  29. <option selected value=1>01
  30. <option value=2>02
  31. <option value=3>03
  32. <option value=4>04
  33. <option value=5>05
  34. <option value=6>06
  35. <option value=7>07
  36. <option value=8>08
  37. <option value=9>09
  38. <option value=10>10
  39. <option value=11>11
  40. <option value=12>12
  41. <option value=13>13
  42. <option value=14>14
  43. <option value=15>15
  44. <option value=16>16
  45. <option value=17>17
  46. <option value=18>18
  47. <option value=19>19
  48. <option value=20>20
  49. <option value=21>21
  50. <option value=22>22
  51. <option value=23>23
  52. <option value=24>24
  53. <option value=25>25
  54. <option value=26>26
  55. <option value=27>27
  56. <option value=28>28
  57. <option value=29>29
  58. <option value=30>30
  59. <option value=31>31</option>
  60. </select>
  61. <input maxlength=4 name=birth_year size=4><br><br>
  62. AGE:&nbsp;&nbsp;
  63. <input type="text" name="age" size="2"><br><br>
  64. AADHAAR Number:&nbsp;&nbsp;
  65. <input type="text" name="aadhaar" maxlength="12" size="12"><br><br>
  66. Gender:<br>
  67. <input type="radio" name="gender" value="M">Male
  68. <input type="radio" name="gender" value="F">Female
  69. <br><br><input type="submit" name="submit">
  70. </form>
  71. </body>
  72. </html>
  73.  
  74. php code:
  75. <?php
  76. $servername="";
  77. $username="root";
  78. $password="";
  79. $db="test";
  80. $name = $_POST['name'];
  81. $address = $_POST['address'];
  82. $birth_month= $_POST['birth_month'];
  83. $birth_day = $_POST['birth_day'];
  84. $birth_year = $_POST['birth_year'];
  85. $gender = $_POST['gender'];
  86. $age=$_POST['age'];
  87. $aadhaar=$_POST['aadhaar'];
  88. $conn=mysqli_connect($servername,$username,$password,$db);
  89. $table="INSERT INTO user(name,address,birth_day,birth_month,birth_year,gender,age,aadhar) VALUES ('$name','$address','$birth_day','$birth_month','$birth_year','$gender','$age','$aadhaar')";
  90. ?>
  91. <html>
  92. <head>
  93. <title>Display Output </title>
  94. </head>
  95. <body>
  96. <h2> Dear
  97. <?php
  98. if ($gender=='M') {
  99. echo "Mr.";
  100. } elseif ($gender=='F') {
  101. echo "Ms.";
  102. }
  103. echo " ", $name;
  104. ?> ! You have entered the following information: </h2>
  105. <table border="1">
  106. <tr>
  107. <td>Address </td>
  108. <td>
  109. <?php echo $address; ?>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>Date of Birth </td>
  114. <td>
  115. <?php echo $birth_month, " ", $birth_day, " ", $birth_year; ?>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td>Age</td>
  120. <td> <?php echo $age;?> </td>
  121. </tr>
  122. <tr>
  123. <td>Aadhaar</td>
  124. <td> <?php echo $aadhaar;?> </td>
  125. </tr>
  126.  
  127. </table>
  128. </body>
  129. </html>
Add Comment
Please, Sign In to add comment