Hello,
How to post an array with associated values?
This works ok
?php
$arr_siirto = array(1,2,3);
print_r($arr_siirto);
$arse = $arr_siirto;
print_r($arse);
?
But if I post it to another form with this:
input type=hidden name=arr_siirt_jouk value=?php echo $arse;?
And print there with:
William Stokes wrote:
How to post an array with associated values?
This works ok
?php
$arr_siirto = array(1,2,3);
print_r($arr_siirto);
$arse = $arr_siirto;
print_r($arse);
?
But if I post it to another form with this:
input type=hidden name=arr_siirt_jouk value=?php echo $arse;?
And
No other way?
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
How to post an array with associated values?
This works ok
?php
$arr_siirto = array(1,2,3);
print_r($arr_siirto);
$arse = $arr_siirto;
print_r($arse);
?
But if I post it to another form with
On 4/20/06, William Stokes [EMAIL PROTECTED] wrote:
Hello,
How to post an array with associated values?
This works ok
?php
$arr_siirto = array(1,2,3);
print_r($arr_siirto);
$arse = $arr_siirto;
print_r($arse);
?
But if I post it to another form with this:
input type=hidden
William Stokes wrote:
No other way?
Over sessions or saving as file and loading it in the following page.
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Can someone help me to get started with serializing? I think I did'nt quite
understand the manual here...
How to post to $PHP_SELF and read this simple array?
?
//print the posted array here
print_r($arr_siirt_jouk);
//create the array and post it in another name
$arr_siirto = array(1,2,3);
William Stokes wrote:
Can someone help me to get started with serializing? I think I did'nt quite
understand the manual here...
How to post to $PHP_SELF and read this simple array?
Why do you want to post it to itself? Why not use a session instead?
It's a lot more efficient.
?
William Stokes a écrit :
Can someone help me to get started with serializing? I think I did'nt quite
understand the manual here...
serialize and unserialize don't modify your variable, but the return
value is a string or a mixed (which means it can be a very complicated
structure, or a
Have a look at :
http://www.weberdev.com/AdvancedSearch.php?searchtype=titlesearch=serializ
berber
-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 20, 2006 1:17 PM
To: php-general@lists.php.net
Subject: Re: [PHP] POST arrays?
Can someone help me
Why do you want to post it to itself? Why not use a session instead?
-I dont know. Never tried session
It's a lot more efficient.
-OK. Is it more complicated to write?
-Will
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
Can someone help me to get
William Stokes wrote:
Why do you want to post it to itself? Why not use a session instead?
-I dont know. Never tried session
It's a lot more efficient.
-OK. Is it more complicated to write?
session is great, gets me high every time. See your local supplier or
go to
OK. Must try that.
BTW theres something odd about my serialize. I got it return something but
not quite what was expected :) Here's the result a:3:{i:0;s:1:
-W
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
Why do you want to post it to itself? Why not use
William Stokes wrote:
OK. Must try that.
BTW theres something odd about my serialize. I got it return something but
not quite what was expected :) Here's the result a:3:{i:0;s:1:
You need to use htmlentities() (http://php.net/htmlentities) on the
serialized data when putting it into the
Is it bad just to remove the single quotes [ ' ] ?
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
OK. Must try that.
BTW theres something odd about my serialize. I got it return something but
not quite what was expected :) Here's the result a:3:{i:0;s:1:
William Stokes wrote:
Is it bad just to remove the single quotes [ ' ] ?
From what? In fact, yes, almost certainly bad.
-Stut
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
OK. Must try that.
BTW theres something odd about my serialize. I
From here:
$arr_siirto = array((serialize('1','2','3'));
after removing the single quotes it started to work.
-W
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
Is it bad just to remove the single quotes [ ' ] ?
From what? In fact, yes, almost certainly
William Stokes wrote:
From here:
$arr_siirto = array((serialize('1','2','3'));
after removing the single quotes it started to work.
Yes, the quotes here are not needed because they're numbers. If they
were not numbers then the quotes would still be needed.
-Stut
--
PHP General Mailing
You're right.
BTW, can sessions and $POST be mixed? If yes is there any reason what so
ever to do that?
-W
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
From here:
$arr_siirto = array((serialize('1','2','3'));
after removing the single quotes it started
William Stokes wrote:
You're right.
I'm also shocked, but only mildly.
BTW, can sessions and $POST be mixed? If yes is there any reason what so
ever to do that?
Your question indicates that you don't understand what sessions are.
Please read
True. I'm not famiar with sessions. I have always used $POST to transmit
variables.
-W
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
You're right.
I'm also shocked, but only mildly.
BTW, can sessions and $POST be mixed? If yes is there any reason
So. If large amount of variables are needed to be preserved in arrays or
otherwise is session the (normal)way to go?
-W
Stut [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED]
William Stokes wrote:
You're right.
I'm also shocked, but only mildly.
BTW, can sessions and $POST be
At 3:55 PM +0300 4/20/06, William Stokes wrote:
BTW, can sessions and $POST be mixed? If yes is there any reason what so
ever to do that?
Yes, you can use sessions, post, get, and cookies all in the same
script if you want.
Yes, there can be reasons to do that.
tedd
--
);
?
Regards!
Edwin.
-Mensaje original-
De: tedd [mailto:[EMAIL PROTECTED]
Enviado el: Jueves, 20 de Abril de 2006 08:28 a.m.
Para: William Stokes; php-general@lists.php.net
Asunto: Re: [PHP] POST arrays?
At 3:55 PM +0300 4/20/06, William Stokes wrote:
BTW, can sessions and $POST
William Stokes wrote:
Hello,
How to post an array with associated values?
This works ok
?php
$arr_siirto = array(1,2,3);
print_r($arr_siirto);
$arse = $arr_siirto;
print_r($arse);
?
But if I post it to another form with this:
input type=hidden name=arr_siirt_jouk value=?php echo $arse;?
On Thu, April 20, 2006 5:18 am, William Stokes wrote:
How to post an array with associated values?
input type=hidden name=arr_siirt_jouk value=?php echo
$arse;?
And print there with:
print_r($arr_siirt_jouk);
prints: Array
So how can post the values forward?
input type=checkbox name=groups[] value=1 checkednbsp; blah1br
input type=checkbox name=groups[] value=2 checkednbps; blah2br
input type=checkbox name=groups[] value=3 checkednbsp; blah3br
I can't seem to access that data correctly when that form gets submitted.
I have tried:
$groups[] =
$groups = $_POST['groups'];
or
if(isset($_POST['groups']) is_array($_POST['groups']))
$groups = $_POST['groups'];
else
$groups = array();
so that groups is an (empty) array even if no checkboxes were checked
mh.
On Wed, 12 Jun 2002, Adam Plocher wrote:
input type=checkbox
Hi Adam:
On Wed, Jun 12, 2002 at 01:15:03PM -0700, Adam Plocher wrote:
input type=checkbox name=groups[] value=3 checkednbsp; blah3br
$groups[] = $_POST['groups[]'];
This is just wrong.
$groups[] = $_POST['groups'];
This assigns the global groups array to one element in a local groups
...
-Original Message-
From: Adam Plocher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 4:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] POST Arrays with register globals..
input type=checkbox name=groups[] value=1 checkednbsp;
blah1br
input type=checkbox name=groups[] value=2 checkednbps
29 matches
Mail list logo