Jump to content


Photo

Echo/Print all variables from POST


  • Please log in to reply
4 replies to this topic

#1 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 23 August 2006 - 03:50 PM

I know I have seen this before but searched and could not make any headway.

I need to know how to basically echo/print all the variables that come through the post on my form handler page.

I have my form and all, which is dynamically adding a checkbox and text area when the user clicks "add task" but I need to see just how everything is passed and what happens if they add a task and leave it blank, etc...

If someone would not mind posting that I would really appreciate it.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 23 August 2006 - 03:53 PM

foreach($_POST as $k => $v) {
  echo $k ." = ".$v."<br />";
}


#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 23 August 2006 - 03:55 PM

<?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>

Ken

#4 lessthanthree

lessthanthree
  • Members
  • PipPipPip
  • Advanced Member
  • 85 posts
  • LocationUK

Posted 23 August 2006 - 03:56 PM

<?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>

Ken


or

<?php
print "<pre>";
print_r($_POST);
print "</pre>";
?>


Same thing, just my preferred method of typing it, find it easier to find where I'm displaying my POST array when it's in a block like that, particularly on a busy page. :)
call me a safe bet, i'm betting i'm not

#5 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 23 August 2006 - 03:59 PM

Each one work and told me what I needed. The "add task" variables are not being passed, only the first set.

Thanks!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users