Passing several variables with the same name

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

Post Reply
Heino
Forum Newbie
Posts: 1
Joined: Tue Jul 09, 2002 10:06 am

Passing several variables with the same name

Post by Heino »

Hello!

Is it somehow possible to pass more than one variable with the same name?
My URL looks like this:
page.php?F=this&F=is&F=a&F=test

I'm using PHP 4.0, and if I try to access these variables, I only get the one that's last in the URL.

I also know that's not really the "fine art" of coding, but I'm pretty new to php and would like to re-use some .asp-functions with as less modifications as possible...

Heino
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You cannot have one variable with multiple values - how do you decide which value gets shown. What happens, as you discovered, if you try to do that all the values get overwritten until only the last is left.

Mac
Post Reply