Passing GET and POST

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
stoneferry
Forum Newbie
Posts: 9
Joined: Sat Feb 16, 2008 10:39 am

Passing GET and POST

Post by stoneferry »

Hi all, I'm new to PHP and just getting my hands dirty with it. I was wondering if you can it is possible with a function in PHP to parse a set GET or POST variables of the same name. For example if you have the URL:

http://www.website.com/webpage.php?colu ... umn3=data9


So as you can see above we have distinct rows and columns in a POST/GET, however, can they be retrieved easily as rows and columns? At present I'm under the pressure the $_GET['column1'] refers only to the first (or is it the last?) instance? Am I correct in thinking this? Is there a way all the data could be parsed into an array.

Or is there just a better way in general of passing tabular information using PHP from an input screen?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Passing GET and POST

Post by Christopher »

You may want to use the syntax to tell PHP to use arrays:

Code: Select all

<input type="text" name="column1[1]"/>
<input type="text" name="column1[2]"/>
<input type="text" name="column2[1]"/>
<input type="text" name="column2[2]"/>
(#10850)
Post Reply