Re: [PHP] serialize() casts numeric string keys to integers

2012-11-12 Thread Adam Richardson
On Mon, Nov 12, 2012 at 2:18 AM, eyal.t wrote: > Hi all, > > Was wondering whether the fact that serialize() casts numeric string keys > to integers, is a bug, intended behaviour, or just something that is minor > enough not to have bothered anyone yet? > This behavior is consistent with the sta

[PHP] serialize() casts numeric string keys to integers

2012-11-11 Thread eyal . t
Hi all, Was wondering whether the fact that serialize() casts numeric string keys to integers, is a bug, intended behaviour, or just something that is minor enough not to have bothered anyone yet? 'string key'); // '1' will be casted to 1 $arr2 = array(1=>'integer key'); $arr1_uns = unserial

Re: [PHP] serialize an object

2007-04-20 Thread Eric Butera
On 4/19/07, Stut <[EMAIL PROTECTED]> wrote: Tobias Wurst wrote: > i use serialize() to save my object in $_SESSION. Why? There's no point in serialising something into $_SESSION. Anything you put in there gets serialised by the session handler. That isn't necessarily 100% true. http://www.stub

Re: [PHP] serialize an object

2007-04-19 Thread Richard Lynch
I'm wondering if the OP is failing to re-define the baseclass when loading in the saved object... But, yes, get rid of the by-hand serializing first, as PHP will serialize it for you. On Thu, April 19, 2007 7:40 am, Zoltán Németh wrote: > as far as I know serialize() saves all the properties of t

RE: [PHP] serialize an object

2007-04-19 Thread Buesching, Logan J
ts.php.net Subject: Re: [PHP] serialize an object as far as I know serialize() saves all the properties of the object... and I think you can store objects in session without serializing it since PHP serializes-unserializes it for you automatically - or not? greets Zoltán Németh 2007. 04. 19,

RE: [PHP] serialize an object

2007-04-19 Thread Buesching, Logan J
>From the PHP manual: -Original Message- From: Zoltán Németh [mailto:[EMAIL PROTECTED] Sent: Thursday, April 19, 2007 8:40 AM To: Tobias Wurst Cc: php-general@lists.php.net Subject: Re: [PHP] serialize an object as far as I know serialize() saves all the properties of the obj

Re: [PHP] serialize an object

2007-04-19 Thread Zoltán Németh
as far as I know serialize() saves all the properties of the object... and I think you can store objects in session without serializing it since PHP serializes-unserializes it for you automatically - or not? greets Zoltán Németh 2007. 04. 19, csütörtök keltezéssel 13.17-kor Tobias Wurst ezt írta

Re: [PHP] serialize an object

2007-04-19 Thread Stut
Tobias Wurst wrote: i use serialize() to save my object in $_SESSION. Why? There's no point in serialising something into $_SESSION. Anything you put in there gets serialised by the session handler. But i have one Problem: the member-variables from the baseclass are not saved.. :( How can i

[PHP] serialize an object

2007-04-19 Thread Tobias Wurst
hi, i use serialize() to save my object in $_SESSION. But i have one Problem: the member-variables from the baseclass are not saved.. :( How can i fix this? thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] serialize() and special ANSI characters

2007-02-20 Thread Richard Lynch
Just a guess: You could perhaps run all your data through base64 encoding or somesuch to be certain the characters to be serialized are all "nice" On Mon, February 19, 2007 8:56 am, Youri LACAN-BARTLEY wrote: > Hi all, > > I'm just curious to find out if I'm the only person to have bumped > into

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-19 17:29:53 +0100: > Roman Neuhauser wrote: > > > >class serializeASCII241 extends Tence_TestCase > >{ > >function testTruncates() > >{ > >return $this->assertEquals( > >"120GB 2X512MB 15.4IN DVD", > >serialize("120GB 2X512MB 15.

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Youri LACAN-BARTLEY
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-02-19 15:56:15 +0100: I'm just curious to find out if I'm the only person to have bumped into this kind of issue with serialize/unserialize. When I try and serialize an array containing a string value with the "?" character (alt+241 ASCII) suc

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-19 15:56:15 +0100: > I'm just curious to find out if I'm the only person to have bumped into > this kind of issue with serialize/unserialize. > > When I try and serialize an array containing a string value with the "?" > character (alt+241 ASCII) such as : > "

[PHP] serialize() and special ANSI characters

2007-02-19 Thread Youri LACAN-BARTLEY
Hi all, I'm just curious to find out if I'm the only person to have bumped into this kind of issue with serialize/unserialize. When I try and serialize an array containing a string value with the "±" character (alt+241 ASCII) such as : "120GB 2X512MB 15.4IN DVD±RW VHP FR" The resul

Re: [PHP] Serialize

2006-05-29 Thread Richard Lynch
On Wed, May 24, 2006 4:50 am, [EMAIL PROTECTED] wrote: > Is a serialized array a "safe" string to insert into a mysql text > field? Or is a > function such as mysql_real_escape_string always needed? Assume that a Bad Guy is smart enough to get SOMETHING in there to mess you up, even if you seriali

Re: [PHP] Serialize

2006-05-24 Thread tedd
At 10:50 AM +0100 5/24/06, [EMAIL PROTECTED] wrote: Hi, Is a serialized array a "safe" string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? regards Simon. Simon: If you want to store a serialized array in mysql, then you must use mysql

Re: [PHP] Serialize

2006-05-24 Thread Robin Vickery
On 24/05/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, Is a serialized array a "safe" string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? No, it's not at all a safe string to insert into a mysql text field. mysql_real_escap_string()

Re: [PHP] Serialize

2006-05-24 Thread Andrei
It's not safe... if the array contains strings which contain ' or " might screw your query... it's safe to escape the string result from serialize... Andy [EMAIL PROTECTED] wrote: Hi, Is a serialized array a "safe" string to insert into a mysql text field? Or is a function such as

Re: [PHP] Serialize

2006-05-24 Thread chris smith
On 5/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, Is a serialized array a "safe" string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? *Always* escape your data. What if your array contains a quote? -- Postgresql & php tutorials

[PHP] Serialize

2006-05-24 Thread phplist
Hi, Is a serialized array a "safe" string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? regards Simon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] serialize() function

2006-04-14 Thread Jochem Maas
tedd wrote: Jochem: $_SESSION has another advantage - everything you stick in it is automagically serialized and unserialized at end/start of the request. I didn't know that. Thanks, now I have to figure out a way to store a $_SESSION in a cookie and read it back without inferring with wh

Re: [PHP] serialize() function

2006-04-14 Thread tedd
Jochem: $_SESSION has another advantage - everything you stick in it is automagically serialized and unserialized at end/start of the request. I didn't know that. Thanks, now I have to figure out a way to store a $_SESSION in a cookie and read it back without inferring with what the user is

Re: [PHP] serialize() function

2006-04-13 Thread Richard K Miller
There's nothing special about the data returned by serialize() except that it can be safely written saved, transmitted, etc. To do anything useful with it you have to unserialize() it. The cool part about it is that you can serialize any data structure, like an entire array or object. T

Re: [PHP] serialize() function

2006-04-13 Thread Richard Lynch
On Thu, April 13, 2006 7:03 pm, Jochem Maas wrote: >> One example, each domain has a limit of cookies (20) and you can use > > I wasn't aware that there was a hard limit on cookies - I always > thought > this was a browser dependent setting ... not that I ever get above > 2 cookies max (and mostly

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Robert Cummings wrote: On Thu, 2006-04-13 at 18:58, tedd wrote: Not that you don't know -- because I'm sure you do -- but for the benefit of others. One example, each domain has a limit of cookies (20) and you can use them up pretty quickly. However, if you place your data in an array, you

Re: [PHP] serialize() function

2006-04-13 Thread Robert Cummings
On Thu, 2006-04-13 at 18:58, tedd wrote: > Not that you don't know -- because I'm sure you do -- but for the > benefit of others. > > One example, each domain has a limit of cookies (20) and you can use > them up pretty quickly. However, if you place your data in an array, > you could then seri

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
tedd wrote: At 12:04 AM +0200 4/14/06, Jochem Maas wrote: Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! $o,"B"=>$a,"C"=>$i,"D"=>$b)),"\n", ?> ... and yes there are uses for it. what do you want

Re: [PHP] serialize() function

2006-04-13 Thread tedd
At 12:04 AM +0200 4/14/06, Jochem Maas wrote: Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! $o,"B"=>$a,"C"=>$i,"D"=>$b)),"\n", ?> ... and yes there are uses for it. what do you want to do? Jochem:

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Nicholas Couloute wrote: I was thinking of a news system with comments. fine. but what's that got to do with serialize() per se? or put another don't look at a function decide it might be useful and then force yourself to build an application with it cart before the horse and all that.

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! $o,"B"=>$a,"C"=>$i,"D"=>$b)),"\n", ?> ... and yes there are uses for it. what do you want to do? ~Nick Couloute co-owner/Web Designer Sidekick2Music.

[PHP] serialize() function

2006-04-13 Thread Nicholas Couloute
Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ~Nick Couloute co-owner/Web Designer Sidekick2Music.Com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] serialize

2005-09-26 Thread Murray @ PlanetThoughtful
> Sent this to [EMAIL PROTECTED] but forgot to copy php-general... > heh. Here it is again. > > I would use a table such as > Table > |_UserData > > Then use objects per user to store the data. > class User { > var TestScore; > var ScoreType; > ... > var Vars; > fun

Re: [PHP] serialize

2005-09-26 Thread Jake Gardner
le EvalType would have a scoreTypeID (from the ScoreTBL) for each userID. > > each user could have multiple scoreTypes in the EvalTBL... > > > > -bruce > > > > > > -Original Message- > > From: Murray @ PlanetThoughtful [mailto:[EMAIL PROTECTED] > >

RE: [PHP] serialize

2005-09-26 Thread Murray @ PlanetThoughtful
> murray... > > it may have been helpful to the guy to also give him an idea of your tbl > structure. i think you're talking about something like: > tbl schema > > EvalTBL >-id >-UserID >-ScoreTypeID > > ScoreTBL >-id >-ScoreType > > table ScoreType could/would have as many

RE: [PHP] serialize

2005-09-26 Thread bruce
kwater dev'; php-general@lists.php.net Subject: RE: [PHP] serialize > I have an app that stores evaluation scores so I have 30+ values all > within a certain range, currently in the db, each of these values has > it's own column: > > Table test >id &g

RE: [PHP] serialize

2005-09-24 Thread Murray @ PlanetThoughtful
> I have an app that stores evaluation scores so I have 30+ values all > within a certain range, currently in the db, each of these values has > it's own column: > > Table test >id >user_id >motivation >caring >personal_characteristics >creativity, >...etc. > > If the

Re: [PHP] serialize

2005-09-24 Thread Gustav Wiberg
- Original Message - From: "blackwater dev" <[EMAIL PROTECTED]> To: Sent: Sunday, September 25, 2005 4:17 AM Subject: [PHP] serialize I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these val

[PHP] serialize

2005-09-24 Thread blackwater dev
I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these values has it's own column: Table test id user_id motivation caring personal_characteristics creativity, ...etc. If the client decides they want to

Re: [PHP] serialize and unserialize

2003-12-22 Thread Marek Kilimajer
You should use stripslashes to get rid of escaped characters in $_COOKIE['data']. Then remember to use addslashes when you want to use $data or $chksum in sql queries. [EMAIL PROTECTED] wrote: Hello all i need a little help with serialize and unserialize here is my code 'cart', 'y' => $pass

[PHP] serialize and unserialize

2003-12-22 Thread webmaster
Hello all i need a little help with serialize and unserialize here is my code 'cart', 'y' => $password); session_register("y"); $var = serialize($data); //$chksum = md5($data . md5('secret salt here')); //$var = serialize(array($data,$chksum)); setcookie('data', $var, time() + 3600); }

Re: [PHP] serialize?

2003-07-08 Thread Dan Anderson
Because it is desirable to create many small tables over one very large table I usually allow PHP to create dynamic tables. For instance, you could have a table called polls, and use the row id to create a unique table: -Dan On Tue, 2003-07-08 at 07:28, Sævar Öfjörð wrote: > Hi. Im coding a po

Re: [PHP] serialize?

2003-07-08 Thread Marek Kilimajer
No, use another table, poll_options: poll_option_id, poll_id, option_text, vote_count hope the structure is self explanatory. Sævar Öfjörð wrote: Hi. I’m coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table ‘polls’. There I keep ba

[PHP] serialize?

2003-07-08 Thread Sævar Öfjörð
Hi. I’m coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table ‘polls’. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll optio

Re: [PHP] serialize/unserialize problem

2002-12-17 Thread Guangzu Wang
nyway! Guangzu - Original Message - From: "Guangzu Wang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 4:48 PM Subject: [PHP] serialize/unserialize problem > Hi, > I am working on mime message and try to pass an array with se

[PHP] serialize/unserialize problem

2002-12-17 Thread Guangzu Wang
Hi, I am working on mime message and try to pass an array with serialize and unserialize and got some problems. Here's some code snippet: in my function, I have this: $message['attachments'] = serialize($attachments); And calling code like this: $attachments = $message['attachments']; echo "ATT

RE: [PHP] Serialize/URLencode query...

2002-05-11 Thread Glenn Sieb
At 12:11 AM 5/12/2002 -0700, John Holmes posted the following... >You should use sessions. All you have to do is call session_start() at >the beginning of your code. Then, any variable you want to save to the >session, you simply use: That did the trick! Thanks for the explanation, John! Now I ha

RE: [PHP] Serialize/URLencode query...

2002-05-11 Thread John Holmes
02 7:57 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Serialize/URLencode query... > > I'd like to pass a bunch of variables to another PHP page for processing > there... I think serialize() and urlencode() will do what I'm looking > for.. > can I pass multiple strings

[PHP] Serialize/URLencode query...

2002-05-11 Thread Glenn Sieb
I'd like to pass a bunch of variables to another PHP page for processing there... I think serialize() and urlencode() will do what I'm looking for.. can I pass multiple strings through this? I'm also not clear on how I can decode the separate strings out... Can someone point me in the right di

[PHP] serialize()

2002-03-27 Thread Rodrigo Peres
Hi list, I've already look at the php manual but couldn't figure out a way to use serialize to solve my problem. I have a form, with many fields like (name, age, adress, state), that I put a save button. This button allows my user to save the fields already filled in order to finish the form late

Re: [PHP] serialize

2002-03-05 Thread bvr
Instead of serialize(), you could also fix your existing code like this: "; } ?> Or "; } ?> bvr. > for ($i=0; $i<$HTTP_GET_VARS['num']; $i++) > { > echo "felnummer "; > } > ?> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.ph

Re: [PHP] serialize

2002-03-05 Thread Erik Price
On Tuesday, March 5, 2002, at 09:58 AM, Axel Nilsson wrote: > I use this code to create a number of fields in a form depending on > what input number I use. My problem occurs when i am going to save it. > Right now only the value of the last field gets stored. I want to > serialize all value

Re: [PHP] serialize

2002-03-05 Thread Tom Rogers
hHi $data = serialize($felnummer); That should do it.. Tom At 12:58 AM 6/03/2002, Axel Nilsson wrote: >Hi All! >I use this code to create a number of fields in a form depending on what >input number I use. My problem occurs when i am going to save it. Right >now only the value of the last fi

[PHP] serialize

2002-03-05 Thread Axel Nilsson
Hi All! I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values from all fields so that they can be saved as a stringvalue i

[PHP] serialize object & session_auto_start

2001-12-05 Thread Matthieu Brunet
Hi, I'm trying to save an object in the session, with the serialize and uunserialize fonction. But i got an error message wich say me that i must define the class before the session start. But my session start automaticly. So I can't include my class before the session start. I'm looking for a wor

RE: [PHP] php serialize

2001-07-03 Thread scott [gts]
From: Alexander Wagner [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 03, 2001 1:46 PM > To: scott [gts]; php > Subject: Re: [PHP] php serialize > > > scott [gts] wrote: > > i want to write serialize() and unserialize() in perl > > so that arrays (no objects or refer

Re: [PHP] php serialize

2001-07-03 Thread Alexander Wagner
scott [gts] wrote: > i want to write serialize() and unserialize() in perl > so that arrays (no objects or references yet) can be > read/written by both PHP and Perl to help with my > cross-language session implementation. Why don't you use WDDX? regards Wagner -- Madness takes its toll. P

[PHP] php serialize

2001-07-03 Thread scott [gts]
does anyone know any good places to look for detailed information about PHP's serialize(), unserialize() (besides the PHP sources, becuase i'm already going thru them) i want to write serialize() and unserialize() in perl so that arrays (no objects or references yet) can be read/written by both P

[PHP] serialize/unzerialize help

2001-03-16 Thread andrie
Hello all members, i am confuse to pass my class object over page (read my quote below). can u give a little example to demonstrate this using serialize and unserialize function. thaks for your attention.. andrie Tuesday, March 13, 2001, 9:03:08 PM, Loe nulis gini:

Re: [PHP] serialize/deserialize data

2001-02-12 Thread Ankur Verma
"Brian V Bonini" <[EMAIL PROTECTED]> To: "PHP Lists" <[EMAIL PROTECTED]> Sent: Tuesday, February 13, 2001 5:36 AM Subject: [PHP] serialize/deserialize data > What exactly does > serialize/deserialize data > mean? > > -- > PHP General Mailing List

Re: [PHP] serialize/deserialize data

2001-02-12 Thread Steve Werby
"Brian V Bonini" <[EMAIL PROTECTED]> wrote: > What exactly does > serialize/deserialize data > mean? See the manual at http://www.php.net/manual/en/function.serialize.php. Serializing is a way of storing values so that they retain their type and structure. Session variables are stored in this wa

[PHP] serialize/deserialize data

2001-02-12 Thread Brian V Bonini
What exactly does serialize/deserialize data mean? -- 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]