Posted By

kidmizere on 12/08/10


Tagged

php variables forms


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vehler


PHP Display All Form Variables


 / Published in: PHP
 

  1. function display_post_get() {
  2. if ($_POST) {
  3. echo "Displaying POST Variables: <br> \n";
  4. echo "<table border=1> \n";
  5. echo " <tr> \n";
  6. echo " <td><b>result_name </b></td> \n ";
  7. echo " <td><b>result_val </b></td> \n ";
  8. echo " </tr> \n";
  9. while (list($result_nme, $result_val) = each($_POST)) {
  10. echo " <tr> \n";
  11. echo " <td> $result_nme </td> \n";
  12. echo " <td> $result_val </td> \n";
  13. echo " </tr> \n";
  14. }
  15. echo "</table> \n";
  16. }
  17. if ($_GET) {
  18. echo "Displaying GET Variables: <br> \n";
  19. echo "<table border=1> \n";
  20. echo " <tr> \n";
  21. echo " <td><b>result_name </b></td> \n ";
  22. echo " <td><b>result_val </b></td> \n ";
  23. echo " </tr> \n";
  24. while (list($result_nme, $result_val) = each($_GET)) {
  25. echo " <tr> \n";
  26. echo " <td> $result_nme </td> \n";
  27. echo " <td> $result_val </td> \n";
  28. echo " </tr> \n";
  29. }
  30. echo "</table> \n";
  31. }
  32. }
  33. // End of display_post_get

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: kidmizere on December 9, 2010

http://www.weberdev.com/get_example-3861.html

You need to login to post a comment.