Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Ex Form</title>
  5. <style>
  6. span{
  7. color: red;
  8. }
  9.  
  10.  
  11. </style>
  12.  
  13. </head>
  14. <body>
  15. <?php
  16.  
  17.  
  18. if(!empty($_POST) && $_POST['password'] == $_POST['cpassword'])
  19. {
  20. if(!empty($_POST) && !empty($_POST['fname']) && !empty($_POST['Lname']) && !empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['cpassword']))
  21. {
  22. echo " <center><p>Votre formulaire a été envoyer avec succés</p></center>";
  23. }
  24. }
  25.  
  26.  
  27.  
  28.  
  29. ?>
  30.  
  31. <form method="POST" action="">
  32. <div>
  33. <label for="fname">Firstname</label>
  34. <input type="text" placeholder="" name="fname" value="<?php echo $_POST['fname'] ?? '' ; ?>">
  35.  
  36. <?php
  37. if(empty($_POST['fname']) && !empty($_POST))
  38. {
  39. echo"<span>le nom est obligatoire</span>";
  40. }
  41.  
  42.  
  43. ?>
  44. </div>
  45. <br>
  46. <br>
  47. <div>
  48. <label for="Lname">Lastname</label>
  49. <input type="text" name="Lname" value="<?php echo $_POST['Lname']?? '' ; ?>">
  50. <?php
  51. if(empty($_POST['Lname']) && !empty($_POST))
  52. {
  53. echo"<span>le prénom est obligatoire</span>";
  54. }
  55.  
  56.  
  57. ?>
  58.  
  59. </div>
  60. <br> <br>
  61. <div>
  62. <label for="email">Email</label>
  63. <input type="email" name="email" value="<?php echo $_POST['email'] ?? ''; ?>">
  64. <?php
  65. if(empty($_POST['email']) && !empty($_POST))
  66. {
  67. echo"<span>Email est obligatoire</span>";
  68. }
  69.  
  70.  
  71. ?>
  72.  
  73. </div>
  74. <br> <br>
  75. <div>
  76. <label for="psassword">Password</label>
  77. <input type="password" name="password" value="<?php echo $_POST['password'] ?? ''; ?>">
  78. <?php
  79. if(empty($_POST['password']) && !empty($_POST))
  80. {
  81. echo"<span>Password est obligatoire</span>";
  82. }
  83.  
  84.  
  85. ?>
  86.  
  87.  
  88. </div>
  89. <br> <br>
  90. <div>
  91. <label for="cpassword">Configure Password</label>
  92. <input type="password" name="cpassword" value="<?php echo $_POST['cpassword'] ?? ''; ?>">
  93.  
  94. <?php
  95. if(empty($_POST['cpassword']) && !empty($_POST))
  96. {
  97. echo"<span>Conférmer votre mot de passe</span>";
  98. }
  99.  
  100. if(!empty($_POST) && $_POST['password']!== $_POST['cpassword'])
  101. {
  102. echo"<span>enter le meme mot de passe</span>";
  103.  
  104. }
  105.  
  106.  
  107.  
  108. ?>
  109.  
  110. <br><br>
  111. </div>
  112. <input type="submit" value="Sent" name="submit">
  113.  
  114.  
  115. </form>
  116.  
  117.  
  118.  
  119. </body>
  120. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement