PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jiop
Forum Newbie
Posts: 11 Joined: Wed Dec 18, 2002 4:00 am
Location: newport beach
Post
by jiop » Sun Mar 30, 2003 4:27 pm
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..
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun Mar 30, 2003 4:29 pm
being sent to the your browser
to the browser?
Code: Select all
<html><body><pre>
<?php print_r($_POST); ?>
</pre></body></html>
Malder
Forum Newbie
Posts: 13 Joined: Wed Mar 19, 2003 11:09 pm
Post
by Malder » Sun Mar 30, 2003 10:02 pm
$_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;
?>
McGruff
DevNet Master
Posts: 2893 Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland
Post
by McGruff » Sun Mar 30, 2003 10:24 pm
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..?
phice
Moderator
Posts: 1416 Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:
Post
by phice » Sun Mar 30, 2003 11:45 pm
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.
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Mon Mar 31, 2003 3:01 am
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
McGruff
DevNet Master
Posts: 2893 Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland
Post
by McGruff » Mon Mar 31, 2003 9:06 am
Thanks Phice I didn't know that.