Sagewire Logo

POST variable as an array?

2 Message(s) by 2 Author(s) originally posted in php general


From: lawpoop Date:   Thursday, October 25, 2007
Hello all -

I saw a PHP project once where the POST variables had an array. I
do not know how to do this myself, and I have not been able to figure
out what terms to search for to find out.

This'd be immensely helpful to me. Currently I use a method like
this:

print_r($_POST);

Array
(
[amount1] => 40
[check_number1] => 1001
[date1] => 10/21/07
[amount2] => 27.50
[check_number2] => 1257
[date2] => 10/23/07
)

But it'd be helpful to have something like:print_r($_POST);

Array
(
[0] => array(
[amount] => 40
[check_number] => 1001
[date] => 10/21/07
),
[1] =>
[amount] => 27.50
[check_number] => 1257
[date] => 10/23/07
)
)

Thanks!


From: Martin Mandl - m2m tech support Date:   Friday, October 26, 2007
wrote in message:
I saw a PHP project once where the POST variables had an array. I
do not know how to do this myself, and I have not been able to figure
out what terms to search for to find out.



Dear lawp,

you've to do that in html in the name tag

e.g. <input ... name="amount[1]" />

Good luck
Martin

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at



Next Message: Comment / Reply function


Blogs related to POST variable as an array?

hi how can host I add the contents of one array to another say a ...
when using POST, php ignores all the values that are “unchecked” in a checkbox how can I make php actually take those values and process them? Are you sure that’s PHP and not the Web Browser? idk if I uncheck all the values, $_POST is ...

Php Tutorial
As you can see, I can use the variable $x from my loop to print out the names in the array. You may have noticed I am also using the variable $namenumber which is always 1 greater than $x. This is because the array numbering starts from ...

Assosiative Arrays via POST
array[array1][array2][item] * @access public * @param string the form of the array * @param string the method used to send the variable possible values are: "post" , "get" and "cookie" .. default is "post" * @return string ...

everybody i cheap followed the instructions in the paypal sandbox ...
Finds whether a variable is an array — this is what I want to do. it’s all in the manual, read this: http://us3.php.net/manual/en/ini.core.php#ini.include-path then read this: http://us3.php.net/set_include_path ...

Ive downloaded dll hosting files to have the ability to decompress ...
session variable saved properly, user redirected, session variable is used to display a message to the user, then unset, print_r proves it is unset, however the db session table shows it still being there….any clue why? ...

Displaying Data
In this case the whole contents of the database is now contained in a special array with the name $result. Before you can output this data you must change each piece into a separate variable. There are two stages to this. Counting Rows ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional