Page 1 of 1
How to find out the POST variables
Posted: Sun Mar 30, 2003 4:27 pm
by jiop
Is there any way to find out which POST variables are being sent to the your browser?
I'm trying to run an authentication script off another server but it requires me to capture one of the variables that is sent..
Posted: Sun Mar 30, 2003 4:29 pm
by volka
being sent to the your browser

to the browser?
Code: Select all
<html><body><pre>
<?php print_r($_POST); ?>
</pre></body></html>
Posted: Sun Mar 30, 2003 10:02 pm
by Malder
$_POST is a associative array of variables passed to the current script via the HTTP POST method so use this:
<?php
foreach($_POST as $v) echo $v;
?>
Posted: Sun Mar 30, 2003 10:24 pm
by McGruff
Malder wrote:$_POST is a associative array of variables passed to the current script via the HTTP POST method so use this:
<?php
foreach($_POST as $v) echo $v;
?>
Missing some "{}" there..?
Posted: Sun Mar 30, 2003 11:45 pm
by phice
McGruff: If and when you use either if,for,while,foreach, etc that uses one line, you don't
need the { }'s.
Example:
Code: Select all
<?php
for ($i = 0; $i < 10; $i++)
echo $i;
?>
or
If the loops uses more then one line of code, then you have to include the {}s.
Posted: Mon Mar 31, 2003 3:01 am
by twigletmac
Best to always include braces though - leads to less mistakes (i.e. when you add a second line) and makes the code easier to read, IMHO.
Mac
Posted: Mon Mar 31, 2003 9:06 am
by McGruff
Thanks Phice I didn't know that.