Advertisement
michaelyuen

Untitled

May 16th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. form1.php
  2. ###########
  3.  
  4. <form action="form2.php" method="POST">
  5.     <select name="userid">
  6.         <option value="1">User 1</option>
  7.         <option value="2">User 2</option>
  8.         <option value="3">User 3</option>
  9.     </select>
  10.     <input type="submit" name="submit" value="Submit">
  11. </form>
  12.  
  13. form2.php
  14. ###########
  15.  
  16. <?php if (ISSET($_POST['submit']) && !empty($_POST['userid'])): ?>
  17. <html>
  18. <body>
  19. <form action="form3.php" method="POST">
  20.     <input type="hidden" name="userid" value="<?= $_POST['userid'];?>">
  21.     <input type="text" name="your_other_input[]">
  22.     <input type="text" name="your_other_input[]">
  23.     <input type="text" name="your_other_input[]">
  24.     <input type="submit" name="submit" value="Submit">
  25. </form>
  26. </body>
  27. </html>
  28.  
  29. <?php else: ?>
  30. <?php exit(header("location: form1.php")); ?>
  31. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement