I am not 100% sure what you are doing here, so I am responding with
this...
if (is_array($_POST['prod']) {
// Value is an Array
$prod = $_POST['prod'];
}else{
// Value is not an array, but the value
// is added to the first element.
$prod[] = $_POST['prod'];
}
With extract, if $_POST['prod'] is an array, then prod will be an array
also.
- Paul
-----Original Message-----
From: Mignon Hunter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 2:09 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] php-db globals turned off
How would you extract variables from arrays?
before I was doing
$prod[] = $_POST['prod'];
$choice[] = $_POST['choice'];
then I could iterate through $prod[], $choice[]
Mignon Hunter
Webmaster
Toshiba International Corporation
(713) 466-0277 x 3461
(800) 466-0277 x 3461
>>> "Paul Miller" <[EMAIL PROTECTED]> 01/27/04 01:06PM >>>
I love this one...
extract($_REQUEST);
but it undermines the whole reason PHP moved to the new default
parameter specification. Be careful with you coding. I use it, and it
makes things much like the pre 4.3.2 release without changing the ini
files. You just have to specify the default $_server and file upload
params. The other option is change the php.ini file for that dir or
globally.
- Paul
-----Original Message-----
From: Mignon Hunter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 12:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php-db globals turned off
How do most of you handle variables in next page after passing.
For instance. What I have right now (very ugly) is:
$email = $_POST['emal'];
$first = $_POST['first'];
$lastl = $_POST['last'];
Then I work with $email, $first etc...
I will have to do this for many, many variables which doesnt seem very
efficient.
I tried:
foreach ($_POST as $key => $value)
$key = $value;
but that didnt work...but I can print them out.
but even if this did work - this wouldnt handle the 2 sets of arrays I
have.
Does anybody have any snippets for this ... ???
Thanks
Mignon Hunter
Webmaster
Toshiba International Corporation
(713) 466-0277 x 3461
(800) 466-0277 x 3461
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php