Re: GET and POST variables name
| From: | Daniel Clark | Date: | Sat, 15 May 2004 16:17:43 +0000 |
| Subject: | Re: GET and POST variables name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186320@lists.php.net to get a copy of this message | ||
http://www.php.net/manual/en/control-structures.foreach.php
Try this.
echo "GET:<BR>";
foreach($_GET as $key => $value)
{
echo "$key = $value <br>";
}
>>i know it could be a stupid problem, but i need a help and i hope u could be generous with
>>me :).
>>this is my code, it writes the list of POST and GET variables.
>>
>><?
>>echo "GET:<BR>";
>>foreach($_GET as $parole)
>>{
>> echo "Parola = $parole <br>";
>>}
>>
>>echo "<br><br>POST:<BR>";
>>foreach($_POST as $parole)
>>{
>> echo "Parola = $parole <br>";
>>}
>>?>
>>
>>i want to write also the name of the variable, for example:
>>if i call my page so ---> index.php?id=2&a=4
>>it writes
>>
>> GET:
>> Parola = 2
>> Parola = 4
>>
>>
>> POST:
>>
>>I want it to write:
>>
>> GET:
>> id = 2
>> a = 4
>>
>>
>> POST:
>>
>>how can I do it?
>>thx for any help.