Guest User

Untitled

a guest
Oct 10th, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. index.html
  2. <html>
  3. <head>
  4. <body>
  5. <center>
  6. <h1>Login Page</h1>
  7. <form action="welcome.php"method="post">
  8. Username:
  9. <input type="text" name="username">
  10. <br>
  11. Password:
  12. <input type="password" name="password">
  13. <br><br>
  14. <input type="submit" name="submit" value="Login">
  15. </form>
  16. </center>
  17. </body>
  18. </head>
  19. </html>
  20. ------------------
  21. display.php
  22. <html>
  23. <body>
  24. <center>
  25. <h1>
  26. Welcome <?php echo $_POST["username"]; ?><br>
  27. </h1></center>
  28.  
  29. </body>
  30. </html>
  31.  
  32.  
  33.  
  34. 4*
  35. <html>
  36. <head>
  37. <body>
  38. <center>
  39. <h1>Registration form</h1>
  40. <form action="display.php" method="post">
  41. First name:
  42. <input type="text" name="name">
  43. <br>
  44. <br>
  45. Last name:
  46. <input type="text" name="userName">
  47. <br><br>
  48. Password:
  49. <input type="password" name="password">
  50. <br><br>
  51. Re-enter Password:
  52. <input type="password" name="re-EnterPassword">
  53. <br><br>
  54. Address:
  55. <textarea name="address"></textarea>
  56. <br><br>
  57. Gender:
  58. <input type="radio" name="gender" value="Male">Male
  59. <input type="radio" name="gender" value="Female">Female
  60. <br><br>
  61. District Name:
  62. <select name ="districtName">
  63. <option value="Chennai">Chennai</option>
  64. <option value="Coimbatore">Coimbatore</option>
  65. </select>
  66. <br><br>
  67. Events:
  68. <input type="checkbox" name="events[]" value="Wedding">Wedding
  69. <input type="checkbox" name="events[]" value="Corporate">Corporate
  70. <input type="checkbox" name="events[]" value="Social">Social
  71. <br><br>
  72. <input type="submit" name="register"value="Register">
  73. </form>
  74. </center>
  75. </body>
  76. </head>
  77. </html>
  78. --------
  79. display.php
  80.  
  81.  
  82. <html>
  83. <body>
  84. <h1>User Details</h1>
  85. Name :<?php echo $_POST["name"]; ?><br>
  86. User name: <?php echo $_POST["userName"]; ?><br>
  87. Address :<?php echo $_POST["address"]; ?><br>
  88. Gender :<?php echo $_POST["gender"]; ?><br>
  89. District Name :<?php echo $_POST["districtName"]; ?><br>
  90. Events:<?php
  91. foreach($_POST["events"] as $selected){
  92. echo $selected.",";
  93. }?>
  94. </body>
  95. </html>
Add Comment
Please, Sign In to add comment