Guest User

Untitled

a guest
Nov 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. if (!$_SESSION['array']) {
  6. $_SESSION['array'] = array();
  7. }
  8. if(count($_POST)>0){
  9. $procs=array("item","price");
  10. foreach($procs as $proc){
  11. $_SESSION['array'][]=array("key"=>$proc,"value"=>$_POST[$proc]);
  12. }
  13. }
  14.  
  15. echo "<form method='POST' action='tester1.php'>";
  16. echo "Item: <input name='item' type='text' size='25' value='' /><br/>";
  17. echo "Price: <input name='price' type='text' size='6' value='' /><br/>";
  18. echo "<input name='action' type='submit' value='add'>";
  19. echo "</form>";
  20.  
  21. echo "<br/><br/>";
  22.  
  23. echo "<pre>";
  24. print_r($_SESSION['array']);
  25. echo "</pre>";
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment