Jump to content

Archived

This topic is now archived and is closed to further replies.

jasonc

getting all info from $_POST[] using while

Recommended Posts

i wish to get all details used in the $_GET statements

i tried this but not sure why it will not work, is this the correct way of have i not got this right

i get an error saying that i have a double arrow ?

please advise

thank you



$postdetails = "";
foreach ($data = $key => $_GET) {
$postdetails .= '.'.$key.'. '.$data[$key].'.\n';
}

Share this post


Link to post
Share on other sites
is it post or get? your title says POST but you are talking about GET in your question. i guess it doesn't matter. it would be like this:
[code]
$postdetails = "";
// use $_POST instead of $_GET if you want to do POST vars
foreach($_GET as $key => $val) {
   $postdetails .= $key . " " . $val . "\n"; //or however you wish to format it
}
[/code]

Share this post


Link to post
Share on other sites
You may want to check print_r() as well:

[a href=\"http://www.php.net/print_r\" target=\"_blank\"]http://www.php.net/print_r[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.