Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Ex Form</title>
- <style>
- span{
- color: red;
- }
- </style>
- </head>
- <body>
- <?php
- if(!empty($_POST) && $_POST['password'] == $_POST['cpassword'])
- {
- if(!empty($_POST) && !empty($_POST['fname']) && !empty($_POST['Lname']) && !empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['cpassword']))
- {
- echo " <center><p>Votre formulaire a été envoyer avec succés</p></center>";
- }
- }
- ?>
- <form method="POST" action="">
- <div>
- <label for="fname">Firstname</label>
- <input type="text" placeholder="" name="fname" value="<?php echo $_POST['fname'] ?? '' ; ?>">
- <?php
- if(empty($_POST['fname']) && !empty($_POST))
- {
- echo"<span>le nom est obligatoire</span>";
- }
- ?>
- </div>
- <br>
- <br>
- <div>
- <label for="Lname">Lastname</label>
- <input type="text" name="Lname" value="<?php echo $_POST['Lname']?? '' ; ?>">
- <?php
- if(empty($_POST['Lname']) && !empty($_POST))
- {
- echo"<span>le prénom est obligatoire</span>";
- }
- ?>
- </div>
- <br> <br>
- <div>
- <label for="email">Email</label>
- <input type="email" name="email" value="<?php echo $_POST['email'] ?? ''; ?>">
- <?php
- if(empty($_POST['email']) && !empty($_POST))
- {
- echo"<span>Email est obligatoire</span>";
- }
- ?>
- </div>
- <br> <br>
- <div>
- <label for="psassword">Password</label>
- <input type="password" name="password" value="<?php echo $_POST['password'] ?? ''; ?>">
- <?php
- if(empty($_POST['password']) && !empty($_POST))
- {
- echo"<span>Password est obligatoire</span>";
- }
- ?>
- </div>
- <br> <br>
- <div>
- <label for="cpassword">Configure Password</label>
- <input type="password" name="cpassword" value="<?php echo $_POST['cpassword'] ?? ''; ?>">
- <?php
- if(empty($_POST['cpassword']) && !empty($_POST))
- {
- echo"<span>Conférmer votre mot de passe</span>";
- }
- if(!empty($_POST) && $_POST['password']!== $_POST['cpassword'])
- {
- echo"<span>enter le meme mot de passe</span>";
- }
- ?>
- <br><br>
- </div>
- <input type="submit" value="Sent" name="submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement