Advertisement
michaelyuen

Untitled

May 25th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. file1.php
  2.  
  3. <form action="file2.php" method="POST">
  4.     <input type="type" name="info">
  5.     <input type="submit" name="submit_from_form1" value="submit">
  6. </form>
  7.  
  8. file2.php
  9.  
  10. if (isset($_POST['submit_from_form1'])) {
  11.     $info = $_POST['info'];
  12. } else {
  13.     // in case user access file2.php directly then redirect back to file1.php
  14.     exit(header('location: file1.php'));
  15. }
  16.  
  17. <form action="file3.php" method="POST">
  18.     <input type="text" name="something">
  19.     <input type="text" name="info" value="<?php echo $info; ?>">
  20.     <input type="submit" name="submit_from_form2" value="submit">
  21. </form>
  22.  
  23. file3.php
  24.  
  25. if (isset($_POST['submit_from_form2'])) {
  26.     $something = $_POST['something'];
  27.     $info = $_POST['info'];
  28.     // update your database
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement