Re: [PHP] Passing Arrays between pages

2005-03-22 Thread Larry E . Ullman
Please can someone tell me how you pass arrays between PHP pages.
$var = serialize($testArray);
echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$var\;
Then unserialize the variable on the receiving page.
Larry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing Arrays between pages

2005-03-22 Thread [EMAIL PROTECTED]
1. you can put your array in string using implode() function and on next 
page create the array back using explode() function.
$testArray = implode('|', $testArray);
#   you will get: Apple|Banana|Peach
On next page: $testArray = explode('|', $testArray);

2. use serialize()/unserialize() functions
For more info read manual.
-afan
PartyPosters wrote:
Hello,
Please can someone tell me how you pass arrays between PHP pages.
I have tried something like this and have tried many variations of this but
nothing working yet ;
Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;
echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$testArray\;
Page2
echo $testArray[1];
On different variations of this I keep on getting 'Array' when I to return 
the variable on the second page
Many Thanks.
Kaan.
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing Arrays between pages

2005-03-22 Thread PartyPosters
Thanks for all your help!!!  managed it with -
$testArray = implode('|', $testArray);
On next page: $testArray = explode('|', $testArray);


- Original Message -
From: [EMAIL PROTECTED]
To: PartyPosters [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Tuesday, March 22, 2005 10:06 PM
Subject: Re: [PHP] Passing Arrays between pages


 1. you can put your array in string using implode() function and on next
 page create the array back using explode() function.
 $testArray = implode('|', $testArray);
 #   you will get: Apple|Banana|Peach
 On next page: $testArray = explode('|', $testArray);

 2. use serialize()/unserialize() functions

 For more info read manual.

 -afan

 PartyPosters wrote:

 Hello,
 Please can someone tell me how you pass arrays between PHP pages.
 I have tried something like this and have tried many variations of this
but
 nothing working yet ;
 
 
 Page 1
 $testArray[0] =Apple;
 $testArray[1] =Banana;
 $testArray[2] =Peach;
 
 echo INPUT NAME = \kcompany[]\ TYPE = \hidden\
VALUE=\$testArray\;
 
 Page2
 echo $testArray[1];
 
 
 On different variations of this I keep on getting 'Array' when I to
return the variable on the second page
 
 Many Thanks.
 Kaan.
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing Arrays between pages

2005-03-22 Thread Josh Whiting
 Please can someone tell me how you pass arrays between PHP pages.
 
 $var = serialize($testArray);
 echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$var\;
 
 Then unserialize the variable on the receiving page.

To this you might also add an MD5 hash to check for authenticity,
depending on what you're doing with that incoming data that you're
unserializing (consider an client who sends you a serialized array that
you didn't intend). You'll also want to encode the serialized data with 
htmlentities:

$serialized = serialize($testArray);
$hash = md5($serialized . my secret phrase);
echo 'input type=hidden name=serialized 
value='.htmlentities($serialized).'';
echo 'input type=hidden name=hash value='.$hash.'';

then on the receiving end:

if ($_POST['hash'] != md5($_POST['serialized'] . my secret phrase) {
  // the hash doesn't match up, consider the data unusable
} else{ 
  $testArray = unserialize($_POST['serialized']);
}

HTH
/jw

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] passing arrays?

2003-12-12 Thread Ford, Mike [LSS]
On 12 December 2003 06:07, motorpsychkill wrote:

 Thanks Tom, that worked!  I knew that $$level had something
 to do with it,
 just wasn't sure what exactly.  Thanks again.
 
 -m
 
 -Original Message-
 From: Tom Rogers [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 11, 2003 9:34 PM
 To: motorpsychkill
 Subject: Re: [PHP] passing arrays?
 
 Always use isset() to check if something exists before trying
 to use it if
 originates externally to the running script.
 
 you probabley need something like this
 
 $level_0 = array('NONE');
 $level_1 = array(PN, GALUP, VP, PUBUP, STATS, MCI,
 CONLIST,CP, OAFS, LO);
 $level_2 = array(PN, GALUP, VP, PUBUP, MCI, CONLIST,
 CP, OAFS, LO); 
 
 if(isset($_SESSION['user']['level'])){
 $level = 'level_'.$_SESSION['user']['level']; }else{
 $level = 'level_0';  //catchall value
 }
 foreach($$level  as $value){
 echo $value.'br';
 }


Actually, I'd like to suggest that a variable variable is the wrong tool for
this, and an array should be used instead -- something like:

   $level = array(1 = array(PN, GALUP, VP, PUBUP,
 STATS, MCI, CONLIST,CP,
 OAFS, LO),
  2 = array(PN, GALUP, VP, PUBUP,
 MCI, CONLIST, CP, OAFS,
 LO)
 );

   if (isset($_SESSION['user']['level'])
isset($level[$_SESSION['user']['level']])):
  foreach ($level[$_SESSION['user']['level']] as $value):
 echo $value.'br';
  endforeach;
   else:
  // invalid level
   endif;

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] passing arrays?

2003-12-12 Thread motorpsychkill
Thank you Mike for your recommendations as well.  I've certainly learned a
few tricks from this thread.  Thanks to all those concerned!

-m

 -Original Message-
 From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 12, 2003 2:41 AM
 To: 'motorpsychkill'; Php General List
 Subject: RE: [PHP] passing arrays?


 On 12 December 2003 06:07, motorpsychkill wrote:

  Thanks Tom, that worked!  I knew that $$level had something
  to do with it,
  just wasn't sure what exactly.  Thanks again.
 
  -m
 
  -Original Message-
  From: Tom Rogers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 11, 2003 9:34 PM
  To: motorpsychkill
  Subject: Re: [PHP] passing arrays?
 
  Always use isset() to check if something exists before trying
  to use it if
  originates externally to the running script.
 
  you probabley need something like this
 
  $level_0 = array('NONE');
  $level_1 = array(PN, GALUP, VP, PUBUP, STATS, MCI,
  CONLIST,CP, OAFS, LO);
  $level_2 = array(PN, GALUP, VP, PUBUP, MCI, CONLIST,
  CP, OAFS, LO);
 
  if(isset($_SESSION['user']['level'])){
  $level = 'level_'.$_SESSION['user']['level']; }else{
  $level = 'level_0';  //catchall value
  }
  foreach($$level  as $value){
  echo $value.'br';
  }


 Actually, I'd like to suggest that a variable variable is the
 wrong tool for
 this, and an array should be used instead -- something like:

$level = array(1 = array(PN, GALUP, VP, PUBUP,
  STATS, MCI, CONLIST,CP,
  OAFS, LO),
   2 = array(PN, GALUP, VP, PUBUP,
  MCI, CONLIST, CP, OAFS,
  LO)
  );

if (isset($_SESSION['user']['level'])
 isset($level[$_SESSION['user']['level']])):
   foreach ($level[$_SESSION['user']['level']] as $value):
  echo $value.'br';
   endforeach;
else:
   // invalid level
endif;

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] passing arrays?

2003-12-11 Thread motorpsychkill
Thanks Tom, that worked!  I knew that $$level had something to do with it,
just wasn't sure what exactly.  Thanks again.

-m

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 9:34 PM
To: motorpsychkill
Subject: Re: [PHP] passing arrays?

Always use isset() to check if something exists before trying to use it if
originates externally to the running script.

you probabley need something like this

$level_0 = array('NONE');
$level_1 = array(PN, GALUP, VP, PUBUP, STATS, MCI,
CONLIST,CP, OAFS, LO);
$level_2 = array(PN, GALUP, VP, PUBUP, MCI, CONLIST, CP,
OAFS, LO);

if(isset($_SESSION['user']['level'])){
$level = 'level_'.$_SESSION['user']['level'];
}else{
$level = 'level_0';  //catchall value
}
foreach($$level  as $value){
echo $value.'br';
}
--
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] passing arrays to a session-variable

2003-02-28 Thread Joshua Moore-Oliva
Try looking at this page

http://www.php.net/manual/en/function.serialize.php

Josh.
On February 28, 2003 08:22 am, Michiel van Heusden wrote:
 I'm using this script to test passing arrays to a Session-variable.

 ?
 session_start();

 // method 1
 $_SESSION['array1'] = array(item1, item2);

 // method 2
 session_register(array2);
 $array2 = array(itemA, itemB);

 header (Content-type: text/html);

 echo $array1[0]. br /;
 echo $array2[0];
 ?

 method 1 doesn't work until another PHP is loaded, only then the var is
 ouputted...
 method 2 works fine, but i'd prefer using $_SESSION all the way instead of
 session_register
 any suggestions?

 grace
 michiel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing Arrays Through Forms

2003-01-17 Thread Sancar Saran
On Thursday 16 January 2003 20:58, [EMAIL PROTECTED] wrote:
 Hello Everyone,

 I've attempted this many times, but have failed to understand it each time.
 I want to make it easier for myself to deal with passing variables through
 a form. So I thought, why not use a single array variable to do that. If I
 do such a thing, what steps do I need to take to ensure that the values in
 the array are intact just as the user entered it? How do I serialize array
 data from an initial form? Here's a simple example of what I might have:

 form method=post action=some_page.php
input type=text name=form_vars['firstname']/input
input type=text name=form_vars['lastname']/input
input type=text name=form_vars['address']/input
input type=text name=form_vars['city']/input
input type=text name=form_vars['state']/input
input type=text name=form_vars['zip']/input
 /form


 form method=post action=some_page.php
input type=text name=form_vars[firstname]/input
input type=text name=form_vars[lastname]/input
input type=text name=form_vars[address]/input
input type=text name=form_vars[city]/input
input type=text name=form_vars[state]/input
input type=text name=form_vars[zip]/input
 /form

some_page.php
?
$form_vars = $_POST[form_vars];

?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays between pages with serialize

2002-08-02 Thread DoL

Thanks, I found the problem was with the creation of the 2-di array.
- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'DoL' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, July 31, 2002 12:21 PM
Subject: RE: [PHP] passing arrays between pages with serialize


 Can you post/send the results of doing a print_r() on the first page (the
 one that's serialising) and the results of the serialize()?

 -Original Message-
 From: DoL [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 2:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing arrays between pages with serialize


 Hi

 I would like to pass three arrays, two of them are two dimensional arrays,
 to another page (or to the same page just submit to itself) using hidden
 field and the function serialize.

 (this is a two dimensional array)
 page-1
  $s_array1 = serialize($array1);

 INPUT type=HIDDEN name=h_array1 value=?php echo
urlencode($s_array1);
 ?

 page-2
  $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

 it seems to work except there appears to be one NULL record added to the
 beginning of the array.
 it affects the following :-
 count(array_keys($array1) ) returns actual_no_of_keys + 1
 foreach () echo with one NULL record at the beginning
 reset($array1) erase the array completely !!

 and it doesn't help to use rawurl(en|de)code, and with | without
 stripslashes!

 PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
 between pages.

 Many Thanks
 /dl



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays between pages with serialize

2002-08-02 Thread DoL

Hi Valeri
Thanks for your advise.  I am new to php and have never used $_SESSION, is
this the one that I need to session_register the variables/arrays?

Thanks again.
Dominic
- Original Message -
From: Valeri Felberg [EMAIL PROTECTED]
To: DoL [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, July 31, 2002 4:57 PM
Subject: Re: [PHP] passing arrays between pages with serialize


 Hallo DoL,

 it worked when i didn't use urldecode(), just stripslashes():

 page-1
  $s_array1 = urlencode(serialize($array1));

  header(Location: page-2?h_array1=$s_array1);

 page-2
  $array1 = unserialize(stripslashes($_GET[h_array1]));


 The other way that worked was passing arrays in $_SESSION. You don't need
 even serialize them in that case.

 D Hi

 D I would like to pass three arrays, two of them are two dimensional
arrays,
 D to another page (or to the same page just submit to itself) using
hidden
 D field and the function serialize.

 D (this is a two dimensional array)
 D page-1
 D  $s_array1 = serialize($array1);

 D INPUT type=HIDDEN name=h_array1 value=?php echo
urlencode($s_array1);
 ?

 D page-2
 D  $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

 D it seems to work except there appears to be one NULL record added to
the
 D beginning of the array.
 D it affects the following :-
 D count(array_keys($array1) ) returns actual_no_of_keys + 1
 D foreach () echo with one NULL record at the beginning
 D reset($array1) erase the array completely !!

 D and it doesn't help to use rawurl(en|de)code, and with | without
 D stripslashes!

 D PLEASE HELP! if you can resolve this, or has a better ways to pass
arrays
 D between pages.

 D Many Thanks
 D /dl






 --
 Mit freundlichen Grüssen
 Valeri Felberg
 [Web developer]

 trimfab - internet mediagroup
 --
 our mission: innovative business solutions


 www.trimfab.com
 mailto:[EMAIL PROTECTED]

 CZEMINSKI-STR. 1A
 10829 BERLIN
 GERMANY

 FON:  +49(0)30 - 768 033 93
 FAX:  +49(0)30 - 768 033 94





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays between pages with serialize

2002-07-31 Thread Valeri Felberg

Hallo DoL,

it worked when i didn't use urldecode(), just stripslashes():

page-1
 $s_array1 = urlencode(serialize($array1));

 header(Location: page-2?h_array1=$s_array1);

page-2
 $array1 = unserialize(stripslashes($_GET[h_array1]));


The other way that worked was passing arrays in $_SESSION. You don't need
even serialize them in that case.
 
D Hi

D I would like to pass three arrays, two of them are two dimensional arrays,
D to another page (or to the same page just submit to itself) using hidden
D field and the function serialize.

D (this is a two dimensional array)
D page-1
D  $s_array1 = serialize($array1);

D INPUT type=HIDDEN name=h_array1 value=?php echo urlencode($s_array1);
?

D page-2
D  $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

D it seems to work except there appears to be one NULL record added to the
D beginning of the array.
D it affects the following :-
D count(array_keys($array1) ) returns actual_no_of_keys + 1
D foreach () echo with one NULL record at the beginning
D reset($array1) erase the array completely !!

D and it doesn't help to use rawurl(en|de)code, and with | without
D stripslashes!

D PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
D between pages.

D Many Thanks
D /dl






-- 
Mit freundlichen Grüssen
Valeri Felberg
[Web developer]

trimfab - internet mediagroup
--
our mission: innovative business solutions


www.trimfab.com
mailto:[EMAIL PROTECTED]

CZEMINSKI-STR. 1A
10829 BERLIN
GERMANY

FON:  +49(0)30 - 768 033 93
FAX:  +49(0)30 - 768 033 94




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing arrays between pages with serialize

2002-07-30 Thread Martin Towell

Can you post/send the results of doing a print_r() on the first page (the
one that's serialising) and the results of the serialize()?

-Original Message-
From: DoL [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing arrays between pages with serialize


Hi

I would like to pass three arrays, two of them are two dimensional arrays,
to another page (or to the same page just submit to itself) using hidden
field and the function serialize.

(this is a two dimensional array)
page-1
 $s_array1 = serialize($array1);

INPUT type=HIDDEN name=h_array1 value=?php echo urlencode($s_array1);
?

page-2
 $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

it seems to work except there appears to be one NULL record added to the
beginning of the array.
it affects the following :-
count(array_keys($array1) ) returns actual_no_of_keys + 1
foreach () echo with one NULL record at the beginning
reset($array1) erase the array completely !!

and it doesn't help to use rawurl(en|de)code, and with | without
stripslashes!

PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
between pages.

Many Thanks
/dl



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2002-05-24 Thread Michael Virnstein

$myarray = unserialize(urldecode($_GET['myarray']));
or am i wrong?

Regards Michael

Miguel Cruz [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 23 May 2002, wm wrote:
  is there a way to pass arrays in forms or in the url?
 
  if i have $myarray=array(one,two,three);
 
  can i pass the whole array at once as opposed to having to pass each
  individual element?

   a href=whatever.php?myarray=?= urlencode(serialize($myarray)) ?

 Then in whatever.php:

   $myarray = unserialize($_GET['myarray']);

 miguel




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing arrays

2002-05-24 Thread John Holmes

Urldecode is automatic when you pass something through the URL. You can
call urldecode, but it doesn't do anything...

---John Holmes...

 -Original Message-
 From: Michael Virnstein [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 24, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] passing arrays
 
 $myarray = unserialize(urldecode($_GET['myarray']));
 or am i wrong?
 
 Regards Michael
 
 Miguel Cruz [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  On Thu, 23 May 2002, wm wrote:
   is there a way to pass arrays in forms or in the url?
  
   if i have $myarray=array(one,two,three);
  
   can i pass the whole array at once as opposed to having to pass
each
   individual element?
 
a href=whatever.php?myarray=?= urlencode(serialize($myarray))
?
 
  Then in whatever.php:
 
$myarray = unserialize($_GET['myarray']);
 
  miguel
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2002-05-23 Thread Pushkar Pradhan

Yes,
You have to append the array name and values to the end of the url.
You've to pass each element from html to php and vice versa, another
method is using
input hidden
http://yoururl.com/index.phpmyarray[]=onemyarray[]=twomyarray[]=three
 hi,

 is there a way to pass arrays in forms or in the url?

 if i have $myarray=array(one,two,three);

 can i pass the whole array at once as opposed to having to pass each
 individual element?

 thanks.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2002-05-23 Thread Nathan

Da. It will create a 3D array, so you would reference the data via:

echo $_GET[myarray][0];
// returns one;
echo $_GET[myarray][1];
// returns two;
...

Or, if you put this in a form, use _POST instead of _GET.

- Original Message - 
From: wm [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 23, 2002 1:49 PM
Subject: [PHP] passing arrays


hi,

is there a way to pass arrays in forms or in the url?

if i have $myarray=array(one,two,three);

can i pass the whole array at once as opposed to having to pass each
individual element?

thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2002-05-23 Thread Miguel Cruz

On Thu, 23 May 2002, wm wrote:
 is there a way to pass arrays in forms or in the url?
 
 if i have $myarray=array(one,two,three);
 
 can i pass the whole array at once as opposed to having to pass each
 individual element?

  a href=whatever.php?myarray=?= urlencode(serialize($myarray)) ?

Then in whatever.php:

  $myarray = unserialize($_GET['myarray']);

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2002-05-23 Thread Nathan

Sorry, I have my brain set on sessions today... The serialize idea presented suggested 
by Miguel is
a good way to do it.


- Original Message -
From: Nathan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; PHP [EMAIL PROTECTED]
Sent: Thursday, May 23, 2002 1:56 PM
Subject: Re: [PHP] passing arrays


Da. It will create a 3D array, so you would reference the data via:

echo $_GET[myarray][0];
// returns one;
echo $_GET[myarray][1];
// returns two;
...

Or, if you put this in a form, use _POST instead of _GET.

- Original Message -
From: wm [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 23, 2002 1:49 PM
Subject: [PHP] passing arrays


hi,

is there a way to pass arrays in forms or in the url?

if i have $myarray=array(one,two,three);

can i pass the whole array at once as opposed to having to pass each
individual element?

thanks.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

In your html input just add [] to the name of your variable so for example:

input type=text name=firstvar[] /

Rick

Not one of them who took up in his youth with this opinion that there are
no gods, ever continued until old age faithful to his conviction. - Plato

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:26:11 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way, to send arrays through
 get strings, or through any other process, without having to serializing
 it? For example, would it be better to use sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Oh sorry I read your message wrong.. But the idea still stands..

a href=nextpage.php?var[]=1var[]=2var[]=3Link/a

Rick

Sir my concern is not whether God is on our side. My great concern is to be
on God's side. - Abraham Lincoln

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:26:11 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way, to send arrays through
 get strings, or through any other process, without having to serializing
 it? For example, would it be better to use sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

Thanks SP and Richard,

Well, I tested it and it works fine with sessions, without serializing
it. The only problem with sending it through GET url strings is that you
can only send about 255 characters of data through to the next page. I
was just looking to see how others pass their array values through their
URLs. So far sessions is a winner, but maybe there's another way. Like
what Richard suggested. But that method seems too time consuming and
will be confusing later on since it uses enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Well what I normally do to pass very large arrays through strings.. when NOT
using sessions, I use serialize, but it sounds like you didn¹t want to
serialize..  If you give me an idea of what you are doing I might be able to
figure out the best way to pass those variables :)

And no you don't need to serialize the data when using sessions.  Sessions
themselves are serialized automatically, you don¹t need to worry about that.

Rick

We do not have to visit a mad house to find disordered minds; our planet is
the mental institution of the universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing
 it. The only problem with sending it through GET url strings is that you
 can only send about 255 characters of data through to the next page. I
 was just looking to see how others pass their array values through their
 URLs. So far sessions is a winner, but maybe there's another way. Like
 what Richard suggested. But that method seems too time consuming and
 will be confusing later on since it uses enumerated arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

Well Rick,

Let's say I had a form with a text box and an textarea box. The text box
won't contain that many strings, but the textarea box can contain
thousands of characters, if the user wished to write that much. Both of
the fields will be contained in a single array. If I send this array
through a GET string, it will only pass 255 characters through to the
next page, and the rest of the content will be cut out of the picture as
if it never existed. Then, I thought maybe sessions would do the trick,
and it does a great job so far. So now I'm stuck with the idea that
using sessions to pass arrays, in the particular situation, would be the
best thing to do. But, out of curiousity, I wanted to know how other
people sent their arrays back and forth from one page to another. That's
all  :)   Thanks for your patience, I really appreciate it.

-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 2:12 PM
To: [EMAIL PROTECTED]; PHP General
Subject: Re: [PHP] passing ARRAYs through GET strings


Well what I normally do to pass very large arrays through strings.. when
NOT using sessions, I use serialize, but it sounds like you didn¹t want
to serialize..  If you give me an idea of what you are doing I might be
able to figure out the best way to pass those variables :)

And no you don't need to serialize the data when using sessions.
Sessions themselves are serialized automatically, you don¹t need to
worry about that.

Rick

We do not have to visit a mad house to find disordered minds; our
planet is the mental institution of the universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing

 it. The only problem with sending it through GET url strings is that 
 you can only send about 255 characters of data through to the next 
 page. I was just looking to see how others pass their array values 
 through their URLs. So far sessions is a winner, but maybe there's 
 another way. Like what Richard suggested. But that method seems too 
 time consuming and will be confusing later on since it uses enumerated
arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Navid Y.

No need to serialize arrays in PHP 4.0. They work seamlessly, as if
you've passed a regular variable through. Thanks for your help and
patience  :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 2:27 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET strings


Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Hey no problem.. That's what this list is for.. Asking questions and
answering them :)

I just use sessions to pass a lot of variables to a lot of pages.. Or some
variables to a lot of pages.. Usually for site authorization that's about
it.  When I just want to pass arrays to another page, I use serialization,
it's the fastest easiest way in my opinion and you don¹t have to mess with
sessions since in my opinion it would be overkill :)

Rick

Nobody will ever win the Battle of the Sexes. There's just too much
fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Well Rick,
 
 Let's say I had a form with a text box and an textarea box. The text box
 won't contain that many strings, but the textarea box can contain
 thousands of characters, if the user wished to write that much. Both of
 the fields will be contained in a single array. If I send this array
 through a GET string, it will only pass 255 characters through to the
 next page, and the rest of the content will be cut out of the picture as
 if it never existed. Then, I thought maybe sessions would do the trick,
 and it does a great job so far. So now I'm stuck with the idea that
 using sessions to pass arrays, in the particular situation, would be the
 best thing to do. But, out of curiousity, I wanted to know how other
 people sent their arrays back and forth from one page to another. That's
 all  :)   Thanks for your patience, I really appreciate it.
 
 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET strings
 
 
 Well what I normally do to pass very large arrays through strings.. when
 NOT using sessions, I use serialize, but it sounds like you didn¹t want
 to serialize..  If you give me an idea of what you are doing I might be
 able to figure out the best way to pass those variables :)
 
 And no you don't need to serialize the data when using sessions.
 Sessions themselves are serialized automatically, you don¹t need to
 worry about that.
 
 Rick
 
 We do not have to visit a mad house to find disordered minds; our
 planet is the mental institution of the universe. - Unknown
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with sessions, without serializing
 
 it. The only problem with sending it through GET url strings is that
 you can only send about 255 characters of data through to the next
 page. I was just looking to see how others pass their array values
 through their URLs. So far sessions is a winner, but maybe there's
 another way. Like what Richard suggested. But that method seems too
 time consuming and will be confusing later on since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET strings
 
 
 Hello   :)
 
 Can anyone suggest of another way, an easier way,
 to send arrays through
 get strings, or through any other process, without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)
 
 Navid
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 - Release
 Date: 07/05/02
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Hey cool, didn't know that.

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 3:45 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


No need to serialize arrays in PHP 4.0. They work
seamlessly, as if
you've passed a regular variable through. Thanks
for your help and
patience  :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 2:27 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Okay let me clarify, if I had an array like this I
would just use sessions this way:

$myarray = array( array('1', '2'),
  array('3', '4') );
$_SESSION['myarray'] = serialize($myarray);

Then you can use the array on any page the user
goes to by doing this:

$myarray = unserialize($_SESSION['myarray']);





-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Thanks SP and Richard,

Well, I tested it and it works fine with sessions,
without serializing
it. The only problem with sending it through GET
url strings is that you
can only send about 255 characters of data through
to the next page. I
was just looking to see how others pass their
array values through their
URLs. So far sessions is a winner, but maybe
there's another way. Like
what Richard suggested. But that method seems too
time consuming and
will be confusing later on since it uses
enumerated arrays. Just need
some suggestions and hints.   :)

-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 1:31 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] passing ARRAYs through GET
strings


Hi Navid

Don't you have to serialize it to put it in
sessions?

-Original Message-
From: Navid Y. [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing ARRAYs through GET strings


Hello   :)

Can anyone suggest of another way, an easier way,
to send arrays through
get strings, or through any other process, without
having to serializing
it? For example, would it be better to use
sessions in this case? Any
help would be greatful, thanks.  :)

Navid


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release
Date: 07/05/02


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Rick, what exactly do you mean by using
serialization without sessions?  how do you do
that?

-Original Message-
From: Richard Baskett
[mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 4:31 PM
To: [EMAIL PROTECTED]; PHP General
Subject: Re: [PHP] passing ARRAYs through GET
strings


Hey no problem.. That's what this list is for..
Asking questions and
answering them :)

I just use sessions to pass a lot of variables to
a lot of pages.. Or some
variables to a lot of pages.. Usually for site
authorization that's about
it.  When I just want to pass arrays to another
page, I use serialization,
it's the fastest easiest way in my opinion and you
don¹t have to mess with
sessions since in my opinion it would be overkill
:)

Rick

Nobody will ever win the Battle of the Sexes.
There's just too much
fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Well Rick,

 Let's say I had a form with a text box and an
textarea box. The text box
 won't contain that many strings, but the
textarea box can contain
 thousands of characters, if the user wished to
write that much. Both of
 the fields will be contained in a single array.
If I send this array
 through a GET string, it will only pass 255
characters through to the
 next page, and the rest of the content will be
cut out of the picture as
 if it never existed. Then, I thought maybe
sessions would do the trick,
 and it does a great job so far. So now I'm stuck
with the idea that
 using sessions to pass arrays, in the particular
situation, would be the
 best thing to do. But, out of curiousity, I
wanted to know how other
 people sent their arrays back and forth from one
page to another. That's
 all  :)   Thanks for your patience, I really
appreciate it.

 -Original Message-
 From: Richard Baskett
[mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
strings


 Well what I normally do to pass very large
arrays through strings.. when
 NOT using sessions, I use serialize, but it
sounds like you didn¹t want
 to serialize..  If you give me an idea of what
you are doing I might be
 able to figure out the best way to pass those
variables :)

 And no you don't need to serialize the data when
using sessions.
 Sessions themselves are serialized
automatically, you don¹t need to
 worry about that.

 Rick

 We do not have to visit a mad house to find
disordered minds; our
 planet is the mental institution of the
universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Thanks SP and Richard,

 Well, I tested it and it works fine with
sessions, without serializing

 it. The only problem with sending it through
GET url strings is that
 you can only send about 255 characters of data
through to the next
 page. I was just looking to see how others pass
their array values
 through their URLs. So far sessions is a
winner, but maybe there's
 another way. Like what Richard suggested. But
that method seems too
 time consuming and will be confusing later on
since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)

 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings


 Hi Navid

 Don't you have to serialize it to put it in
 sessions?

 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] passing ARRAYs through GET
strings


 Hello   :)

 Can anyone suggest of another way, an easier
way,
 to send arrays through
 get strings, or through any other process,
without
 having to serializing
 it? For example, would it be better to use
 sessions in this case? Any
 help would be greatful, thanks.  :)

 Navid


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
 http://www.php.net/unsub.php


 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 -
Release
 Date: 07/05/02

 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.361 / Virus Database: 199 -
Release
 Date: 07/05/02


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
http://www.php.net/unsub.php




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit:
http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked

Re: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread Richard Baskett

Well you can serialize an array using the serialize function then pass it
through the url then unserialize it on the next page using the unserialize
function.  If you check out http://www.php.net/serialize it will give you
some examples.  It is quite similar to sessions in that sessions also
serialize the data, but there are subtle differences.  You will need to use
a couple other functions with serialize when passing through the URL, but
that is documented on the page I just gave you :)

If you have any other questions concerning it please do not hesitate to ask
me :)

Rick

Until you have learned to be tolerant with those who do not always agree
with you; until you have cultivated the habit of saying some kind word of
those whom you do not admire; until you have formed the habit of looking for
the good instead of the bad there is in others, you will be neither
successful nor happy. - Napolean Hill


 From: SP [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 16:35:00 -0400
 To: Richard Baskett [EMAIL PROTECTED], [EMAIL PROTECTED], PHP
 General [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET strings
 
 Rick, what exactly do you mean by using
 serialization without sessions?  how do you do
 that?
 
 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 4:31 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings
 
 
 Hey no problem.. That's what this list is for..
 Asking questions and
 answering them :)
 
 I just use sessions to pass a lot of variables to
 a lot of pages.. Or some
 variables to a lot of pages.. Usually for site
 authorization that's about
 it.  When I just want to pass arrays to another
 page, I use serialization,
 it's the fastest easiest way in my opinion and you
 don¹t have to mess with
 sessions since in my opinion it would be overkill
 :)
 
 Rick
 
 Nobody will ever win the Battle of the Sexes.
 There's just too much
 fraternizing with the enemy. - Henry Kissinger
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 Well Rick,
 
 Let's say I had a form with a text box and an
 textarea box. The text box
 won't contain that many strings, but the
 textarea box can contain
 thousands of characters, if the user wished to
 write that much. Both of
 the fields will be contained in a single array.
 If I send this array
 through a GET string, it will only pass 255
 characters through to the
 next page, and the rest of the content will be
 cut out of the picture as
 if it never existed. Then, I thought maybe
 sessions would do the trick,
 and it does a great job so far. So now I'm stuck
 with the idea that
 using sessions to pass arrays, in the particular
 situation, would be the
 best thing to do. But, out of curiousity, I
 wanted to know how other
 people sent their arrays back and forth from one
 page to another. That's
 all  :)   Thanks for your patience, I really
 appreciate it.
 
 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings
 
 
 Well what I normally do to pass very large
 arrays through strings.. when
 NOT using sessions, I use serialize, but it
 sounds like you didn¹t want
 to serialize..  If you give me an idea of what
 you are doing I might be
 able to figure out the best way to pass those
 variables :)
 
 And no you don't need to serialize the data when
 using sessions.
 Sessions themselves are serialized
 automatically, you don¹t need to
 worry about that.
 
 Rick
 
 We do not have to visit a mad house to find
 disordered minds; our
 planet is the mental institution of the
 universe. - Unknown
 
 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 Thanks SP and Richard,
 
 Well, I tested it and it works fine with
 sessions, without serializing
 
 it. The only problem with sending it through
 GET url strings is that
 you can only send about 255 characters of data
 through to the next
 page. I was just looking to see how others pass
 their array values
 through their URLs. So far sessions is a
 winner, but maybe there's
 another way. Like what Richard suggested. But
 that method seems too
 time consuming and will be confusing later on
 since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)
 
 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings
 
 
 Hi Navid
 
 Don't you have to serialize it to put it in
 sessions?
 
 -Original Message-
 From: Navid Y. [mailto:[EMAIL PROTECTED

RE: [PHP] passing ARRAYs through GET strings

2002-05-18 Thread SP

Thanks Rick, that's what I thinking.  Thought I
was missing something.


-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: May 18, 2002 4:49 PM
To: SP; PHP General
Subject: Re: [PHP] passing ARRAYs through GET
strings


Well you can serialize an array using the
serialize function then pass it
through the url then unserialize it on the next
page using the unserialize
function.  If you check out
http://www.php.net/serialize it will give you
some examples.  It is quite similar to sessions in
that sessions also
serialize the data, but there are subtle
differences.  You will need to use
a couple other functions with serialize when
passing through the URL, but
that is documented on the page I just gave you :)

If you have any other questions concerning it
please do not hesitate to ask
me :)

Rick

Until you have learned to be tolerant with those
who do not always agree
with you; until you have cultivated the habit of
saying some kind word of
those whom you do not admire; until you have
formed the habit of looking for
the good instead of the bad there is in others,
you will be neither
successful nor happy. - Napolean Hill


 From: SP [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 16:35:00 -0400
 To: Richard Baskett [EMAIL PROTECTED],
[EMAIL PROTECTED], PHP
 General [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
strings

 Rick, what exactly do you mean by using
 serialization without sessions?  how do you do
 that?

 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: May 18, 2002 4:31 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings


 Hey no problem.. That's what this list is for..
 Asking questions and
 answering them :)

 I just use sessions to pass a lot of variables
to
 a lot of pages.. Or some
 variables to a lot of pages.. Usually for site
 authorization that's about
 it.  When I just want to pass arrays to another
 page, I use serialization,
 it's the fastest easiest way in my opinion and
you
 don¹t have to mess with
 sessions since in my opinion it would be
overkill
 :)

 Rick

 Nobody will ever win the Battle of the Sexes.
 There's just too much
 fraternizing with the enemy. - Henry Kissinger

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 14:43:27 -0500
 To: 'PHP General' [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings

 Well Rick,

 Let's say I had a form with a text box and an
 textarea box. The text box
 won't contain that many strings, but the
 textarea box can contain
 thousands of characters, if the user wished to
 write that much. Both of
 the fields will be contained in a single array.
 If I send this array
 through a GET string, it will only pass 255
 characters through to the
 next page, and the rest of the content will be
 cut out of the picture as
 if it never existed. Then, I thought maybe
 sessions would do the trick,
 and it does a great job so far. So now I'm
stuck
 with the idea that
 using sessions to pass arrays, in the
particular
 situation, would be the
 best thing to do. But, out of curiousity, I
 wanted to know how other
 people sent their arrays back and forth from
one
 page to another. That's
 all  :)   Thanks for your patience, I really
 appreciate it.

 -Original Message-
 From: Richard Baskett
 [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 2:12 PM
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] passing ARRAYs through GET
 strings


 Well what I normally do to pass very large
 arrays through strings.. when
 NOT using sessions, I use serialize, but it
 sounds like you didn¹t want
 to serialize..  If you give me an idea of what
 you are doing I might be
 able to figure out the best way to pass those
 variables :)

 And no you don't need to serialize the data
when
 using sessions.
 Sessions themselves are serialized
 automatically, you don¹t need to
 worry about that.

 Rick

 We do not have to visit a mad house to find
 disordered minds; our
 planet is the mental institution of the
 universe. - Unknown

 From: Navid Y. [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 May 2002 13:51:38 -0500
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] passing ARRAYs through GET
 strings

 Thanks SP and Richard,

 Well, I tested it and it works fine with
 sessions, without serializing

 it. The only problem with sending it through
 GET url strings is that
 you can only send about 255 characters of data
 through to the next
 page. I was just looking to see how others
pass
 their array values
 through their URLs. So far sessions is a
 winner, but maybe there's
 another way. Like what Richard suggested. But
 that method seems too
 time consuming and will be confusing later on
 since it uses enumerated
 arrays. Just need
 some suggestions and hints.   :)

 -Original Message-
 From: SP [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 18, 2002 1:31 PM
 To: [EMAIL

Re: [PHP] Passing Arrays

2002-04-22 Thread Matt Williams

On Monday 22 April 2002 11:40 am, Boaz Yahav wrote:
 Suppose i have a multiple select posted to a script by a form.
 now i have to send this array again with a new form to a new
 script.
  
 How do i do this?
  
 thanks
  
 berber


Hi Berber

you could serialize the array into a hidden field on the next form.

matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Passing Arrays

2002-04-22 Thread Maxim Maletsky \(PHPBeginner.com\)

Add it to the session.
Sessions can handle arrays with no problems.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins




-Original Message-
From: Matt Williams [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 11:47 AM
To: Boaz Yahav; PHP General (E-mail)
Subject: Re: [PHP] Passing Arrays


On Monday 22 April 2002 11:40 am, Boaz Yahav wrote:
 Suppose i have a multiple select posted to a script by a form. now i 
 have to send this array again with a new form to a new script.
  
 How do i do this?
  
 thanks
  
 berber


Hi Berber

you could serialize the array into a hidden field on the next form.

matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing arrays

2001-06-23 Thread Zak Greant

Jason Jacobs wrote:
 Hi all.  I'm trying to pass an array to another page, and I'm not having
 luck.  I thought maybe it would do something slick by passing it in the
 url, but it doesn't.  So, how can I pass the array?

You can pass an array between pages by using the serialize() and
unserialize() functions in conjunction with rawurlencode().

Serializing a variable is kind of like freezing food.

You freeze food so that you can store it for later use. Serializing
does roughly the same thing for a variable, converting a 'fresh'
variable into a string that you can store and then 'thaw' for later
use.


The basic steps to use serialize to transfer data between pages are:

0.) Page foo.php has an array that it wants to pass to bar.php

$array = array ('doe', 'diddy', 'dee', 'dum');

1.) Serialize the array

$serialized_array = serialize ($array);

2.) Make the serialized data safe for transport via http by passing it
to rawurlencode()

$serialized_array = rawurlencode ($serialized_array);

3.) Pass the serialized array to another page via GET. (You could also
use a form and POST)

echo The serialized array looks like this: $serialized_arraybr;
a href=bar.php?array=?php echo $serialized_array ?Send/a

4.) Unserialize the array at page bar.php
(You may need to call stripslashes() on the passed data - review
the magic_quotes directives in your php.ini file for more
information)

$array = unserialize (stripslashes ($array));

5.) Voilà! Garnish with a 'Powered by PHP Logo' and it is ready to
serve. ;)


Good Luck!

--zak





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing arrays

2001-06-22 Thread Phillip Bow

You could use sessions, but it may be overkill for what you are trying to
do.
--
phill

Jason Jacobs [EMAIL PROTECTED] wrote in message
001201c0fb50$6f895300$7feb1e18@superman">news:001201c0fb50$6f895300$7feb1e18@superman...
Hi all.  I'm trying to pass an array to another page, and I'm not having
luck.  I thought maybe it would do something slick by passing it in the url,
but it doesn't.  So, how can I pass the array?  I've done it before by going
through the array and making a hidden input field for each of the entries,
but this is in just a processing script that redirects to the display page
right after.  Would it be easiest to just do it all on one page?  Thanks for
the help.

-Jason



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Passing arrays from page to page

2001-04-25 Thread ..s.c.o.t.t.. [gts]

well, one idea is to serialize the array and put
into a HIDDEN text field to be submitted with
the FORM.

or, with no form, try this:
doc.php?myarray=. htmlentities(serialize($array));

 -Original Message-
 From: Clif [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Passing arrays from page to page
 
 I'm trying pass an array from one page to another.
 
 Page 1 is a form.
 Page 2 has the data sent by Page 1 available in $HTTP_POST_VARS.
 This is where I'm stuck: Page three needs access to those same variables
 in $HTTP_POST_VARS.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Passing Arrays

2001-04-05 Thread Rudolf Visagie

Hi Jordan,

Using sessions in PHP4, like this:

session_start();
$n = -1;
//Read an index from an Oracle table
while (OCIFetch($rs)) {
$n = $n + 1;
$ix[$n] = OCIResult($rs,1);
}
session_register("n");
session_register("ix");

In the next page you have a session_start() again, and can refer to $ix[0],
$ix[1],.. $ix[$n] etc.

Rudolf Visagie
[EMAIL PROTECTED]


-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: 05 April 2001 02:56
To: PHP Database Mailing List; PHP General Mailing List
Subject: [PHP] Passing Arrays


Hi,
How can I pass an array between two pages. I've tried using serialize and 
unserialize. But it doen't return an array. When I use gettype() on it, it 
say's that the typ-e is boolean?

Any ideas?

Cheers,

Jord

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing Arrays

2001-04-05 Thread Jordan Elver

Cheers, that works great. I tried using urlencode but that doens't work like 
it should in the manual.

Thanks,

Jord

On Thursday 05 April 2001 14:41, you wrote:
 You have to do this:

 $myarray = rawurlencode(serialize($myarray));

 And then this on your other page:

 $myarray = unserialize(rawurldecode($myarray));

 You should consider using sessions instead.


 Jordan Elver [EMAIL PROTECTED] wrote:
 Hi,
 How can I pass an array between two pages. I've tried using serialize and
 unserialize. But it doen't return an array. When I use gettype() on it, it
 say's that the typ-e is boolean?

 Any ideas?

 Cheers,

 Jord

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing arrays as arguments to a method

2001-02-08 Thread Chris Lee

Ive seen posts like this before ( 'how do I pass arrays as arguments to
functions?' ) this is quite simple, nothing at all has to be done.

?php

 class test
 {
  function test($array)
  {
   foreach($array as $pos = $val)
echo "$pos : $val br\n";
  }
 }

 $arr[] = 'chris ';
 $arr[] = 'lee ';
 $arr[] = 'works for ';
 $arr[] = 'mediawaveonline.com ';

 $test = new test($arr);
?

there's nothing to it.


--



Chris Lee
Mediawaveonline.com
[EMAIL PROTECTED]




"rodrigo" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is it possible to pass arrays as arguments to class methods? If so, how?
 What is the proper syntax and things to look out for.

 Thanks in advanced.
 --
 
 Ivan R. Quintero E.* (507)228-3477
 Aptdo 1263* (507)228-9105
 Balboa, Ancon* 640-0370
 Republic of Panama *
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing arrays of objects

2001-02-01 Thread Teodor Cimpoesu



"Conover, Ryan" wrote:
 
 I was wondering if I can pass an array that has serialized objects to next
 page via url encoding
 
 $foo  //array with serialized objects in it
 
 with the following encoding
 
 something/something/foobar.php?foo=echo($foo)
 
 and be able too unserialize $foo on the next page(foovar.php)

I would go with rawurlencode (serialize ($foo)), as the value, and
I guess it will work.

BTW, why aren't you using the session support? In that case it will pass
only the session ID,and the data associated w/ it will be un/serialized
only
on the server, w/o being passed back and forth.

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] passing arrays via forms ..

2001-01-23 Thread Neil Kimber

serialise it using serialize() - see under chapter 12 of the PHP manual
'Miscellaneous functions'

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2001 12:42
To: PHP list
Subject: [PHP] passing arrays via forms ..


howdy again :)

does anybody knwo how to pass an array via forms using something like

 input type=\"hidden\" name=\"client_services\" value=\"$client_services\"

where $client_services is an array ?

Hetni

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]