RE: Re: [PHP] Passing through Array's to another script
| From: | UGBI) | Date: | Tue, 18 Dec 2001 14:07:02 +0000 |
| Subject: | RE: Re: [PHP] Passing through Array's to another script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78063@lists.php.net to get a copy of this message | ||
Maybe you should take a look at serialize and unserialize?
http://nl.php.net/manual/nl/function.serialize.php
http://nl.php.net/manual/nl/function.unserialize.php
With serialize you translate a variable to a string. With unserialize you
translate it back to the original variable
Jerry Verhoef
-----Original Message-----
From: TD - Sales International Holland B.V. [mailto:td@salesint.com]
Sent: Tuesday, December 18, 2001 10:03 PM
To: php-general@lists.php.net
Subject: Fwd: Re: [PHP] Passing through Array's to another script
---------- Forwarded Message ----------
Subject: Re: [PHP] Passing through Array's to another script
Date: Tue, 18 Dec 2001 22:01:53 +0100
From: TD - Sales International Holland B.V. <td@salesint.com>
To: "gkin" <gkin@cyntrix.nl>
On Tuesday 18 December 2001 14:43, you wrote:
Ok I'm a newbie but there some things I think I can point out.
why does your ACTION have a GET method URL??? the ?xtabel should be filled
in
by the form not by you. Second you can't access arrays like print($xtabel)
that will only print the constant Array not the values in there, you're
gonna
need a loop for that. I think the best solution for you would be to create
sessions and register the array within the session. And like I said, making
a
POST form with a GET URL attached to it makes no sense to me at all. What
you could try, but I'm guessing here is the following.
print("<FORM METHOD=POST ACTION=\"script.php\">\n");
$val = current($xtabel);
print("<INPUT TYPE=HIDDEN NAME=xtabel[] VALUE=\"$val\">\n");
/* You need the [] at xtabel cuz else the older value will be overwritten,
this will make it clear to PHP that it's an array/hash*/
while ($val = next($xtabel) {
print("<INPUT TYPE=HIDDEN NAME=xtabel[] VALUE=\"$val\">\n");
}
print("INPUT TYPE=SUBMIT NAME=SUBMIT>\n");
print("</FORM>");
I HAVE NOT!!! tested this but I think it might work. Since I didn't check
it
might have some typos, you'll have to try I'm low on time and like I said
I'm
new to this also, so no guarentees :-).
Kind regards
> I want to pass through an array with content to another script. The array
> is correctly filled with data. To do this I use the following code:
> <FORM METHOD='post' ACTION='script.php?xtabel = <? print($xtabel);
> ?>'>
>
> The content of the array is not recognised in the script.php. What is the
> best way to do this?
-------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
The information contained in this email is confidential and
may be legally privileged. It is intended solely for the
addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any
form of disclosure, production, distribution or any action
taken or refrained from in reliance on it, is prohibited and
may be unlawful. Please notify the sender immediately.
The content of the email is not legally binding unless
confirmed by letter bearing two authorized signatures.