RE: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

2011-07-21 Thread Cor
OK, so when I change the output line in my PHP from:
print  $response;
to
print returnString=$response;

It traces out a correct XML:
?xml version=1.0 encoding=UTF-8 ?
dataprojectproject_code![CDATA[1]]/project_codeproject_datum![C
DATA[2011-07-19]]/project_datumproject_klant_nummer![CDATA[1]]/proje
ct_klant_nummerproject_naam![CDATA[project naam
1]]/project_naamproject_omschrijving![CDATA[project omschrijving
1]]/project_omschrijvingproject_werkzaamheden![CDATA[project
werkzh]]/project_werkzaamhedenproject_ordernummer_klant![CDATA[project
ordernummer klant
1]]/project_ordernummer_klantproject_contactpersoon![CDATA[project
Tinus
Plosteling]]/project_contactpersoonproject_aanneemsom![CDATA[3000.00]]
/project_aanneemsomproject_opdracht![CDATA[lopend]]/project_opdracht
/project/data

So flash expects a key-value pair!!!

Thanks to all you responded to help me

Best regards,
Cor van Dooren
www.codobyte.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor
Sent: donderdag 21 juli 2011 9:04
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Incorrect XML from PHP to Flash

Hi Karl,

Thank you!
I already use mysql_real_escape_string() to write to my database.
And in fact I am reading the http://www.php.net/manual/... at the moment you
send your mail.

I do think it has to do with using URLVariables in Flash rather than my
database or PHP.
I have looked at the tutorials on
http://www.developphp.com/view.php?tid=740t=Discover_Dynamic_XML_MySQL_PHP_
Database_Results_Loop_Tutorial
 and there is the same construction but his works appearantly...
 
Best regards,
Cor 


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: donderdag 21 juli 2011 8:49
To: Flash Coders List
Subject: Re: [Flashcoders] Incorrect XML from PHP to Flash

Hi Cor,
I think it is because information added to a database is usually escaped, so
when you pull it out, you get the escaped string instead of what you
originally typed.
Most, not all php coders, will put the string through something like
mysql_real_escape_string()
before inserting it into the database which will produce the exact results
your getting.
If you apply one of the following functions to the information once pulled
out, it should work.

You could try..

$String = htmlspecialchars_decode($string, ENT_QUOTES);

or

$String = html_entity_decode($string, ENT_QUOTES, 'UTF-8');

(There are also different options for the second and third parameters.
ENT_QUOTES and 'UTF-8' can be changed to your suiting depending on what
style of quoting or character set you need. But for what your needing, I
think ENT_QUOTES is right.
It will return p  instead of quote;lt;pgt;quote; (that is what
ENT_NOQUOTES does).)

I suggest these links if you want to learn more about what's going on with
these to see if they are a fit.

http://www.php.net/manual/en/function.htmlspecialchars-decode.php

http://www.php.net/manual/en/function.html-entity-decode.php

Also, if you find it still not working, use one of the above functions, but
then try putting the return $String text inside a CDATA [].

HTH,

Best,
Karl


On Jul 21, 2011, at 12:41 AM, Cor wrote:

 Is the issue due to sending URLVariables to PHP and Flash expects a 
 value-pair back???


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

2011-07-21 Thread Karl DeSaulniers

Good to hear.

Best,
Karl


On Jul 21, 2011, at 2:34 AM, Cor wrote:


OK, so when I change the output line in my PHP from:
print  $response;
to
print returnString=$response;

It traces out a correct XML:
?xml version=1.0 encoding=UTF-8 ?
dataprojectproject_code![CDATA[1]]/ 
project_codeproject_datum![C
DATA[2011-07-19]]/project_datumproject_klant_nummer![CDATA[1]] 
/proje

ct_klant_nummerproject_naam![CDATA[project naam
1]]/project_naamproject_omschrijving![CDATA[project omschrijving
1]]/project_omschrijvingproject_werkzaamheden![CDATA[project
werkzh]]/project_werkzaamhedenproject_ordernummer_klant![CDATA 
[project

ordernummer klant
1]]/project_ordernummer_klantproject_contactpersoon![CDATA 
[project

Tinus
Plosteling]]/project_contactpersoonproject_aanneemsom![CDATA 
[3000.00]]
/project_aanneemsomproject_opdracht![CDATA[lopend]]/ 
project_opdracht

/project/data


So flash expects a key-value pair!!!

Thanks to all you responded to help me

Best regards,
Cor van Dooren
www.codobyte.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor
Sent: donderdag 21 juli 2011 9:04
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Incorrect XML from PHP to Flash

Hi Karl,

Thank you!
I already use mysql_real_escape_string() to write to my database.
And in fact I am reading the http://www.php.net/manual/... at the  
moment you

send your mail.

I do think it has to do with using URLVariables in Flash rather  
than my

database or PHP.
I have looked at the tutorials on
http://www.developphp.com/view.php? 
tid=740t=Discover_Dynamic_XML_MySQL_PHP_

Database_Results_Loop_Tutorial
 and there is the same construction but his works appearantly...

Best regards,
Cor


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: donderdag 21 juli 2011 8:49
To: Flash Coders List
Subject: Re: [Flashcoders] Incorrect XML from PHP to Flash

Hi Cor,
I think it is because information added to a database is usually  
escaped, so

when you pull it out, you get the escaped string instead of what you
originally typed.
Most, not all php coders, will put the string through something like
mysql_real_escape_string()
before inserting it into the database which will produce the exact  
results

your getting.
If you apply one of the following functions to the information once  
pulled

out, it should work.

You could try..

$String = htmlspecialchars_decode($string, ENT_QUOTES);

or

$String = html_entity_decode($string, ENT_QUOTES, 'UTF-8');

(There are also different options for the second and third parameters.
ENT_QUOTES and 'UTF-8' can be changed to your suiting depending on  
what
style of quoting or character set you need. But for what your  
needing, I

think ENT_QUOTES is right.
It will return p  instead of quote;lt;pgt;quote; (that is what
ENT_NOQUOTES does).)

I suggest these links if you want to learn more about what's going  
on with

these to see if they are a fit.

http://www.php.net/manual/en/function.htmlspecialchars-decode.php

http://www.php.net/manual/en/function.html-entity-decode.php

Also, if you find it still not working, use one of the above  
functions, but

then try putting the return $String text inside a CDATA [].

HTH,

Best,
Karl


On Jul 21, 2011, at 12:41 AM, Cor wrote:


Is the issue due to sending URLVariables to PHP and Flash expects a
value-pair back???


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

2011-07-21 Thread Henrik Andersson

Cor skriver:

OK, so when I change the output line in my PHP from:
print  $response;
to
print returnString=$response;

So flash expects a key-value pair!!!



Now the real question is, why is Flash expecting that format to begin 
with? You shouldn't change your php code. You should change the 
actionscript code.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

2011-07-21 Thread Cor
Thank you.

I have:
var myXML:XML =  XML(e.target.data.returnString);
trace(myXML); outputs correctly:
--
data
  project
project_code![CDATA[1]]/project_code
project_datum![CDATA[2011-07-19]]/project_datum
project_naam![CDATA[project naam 1]]/project_naam
project_omschrijving![CDATA[project omschrijving
1]]/project_omschrijving
project_werkzaamheden![CDATA[project
werkzh]]/project_werkzaamheden
project_opdracht![CDATA[lopend]]/project_opdracht
project_klant_nummer![CDATA[1]]/project_klant_nummer
project_ordernummer_klant![CDATA[project ordernummer klant
1]]/project_ordernummer_klant
project_contactpersoon![CDATA[project Tinus
Plosteling]]/project_contactpersoon
project_aanneemsom![CDATA[3000.00]]/project_aanneemsom
  /project
  project
project_code![CDATA[2]]/project_code
project_datum![CDATA[2011-07-21]]/project_datum
project_naam![CDATA[naam 2]]/project_naam
project_omschrijving![CDATA[omsch 2]]/project_omschrijving
project_werkzaamheden![CDATA[werk 2]]/project_werkzaamheden
project_opdracht![CDATA[geen order]]/project_opdracht
project_klant_nummer![CDATA[2]]/project_klant_nummer
project_ordernummer_klant![CDATA[ord-kl
2]]/project_ordernummer_klant
project_contactpersoon![CDATA[contp 2]]/project_contactpersoon
project_aanneemsom![CDATA[]]/project_aanneemsom
  /project
/data
--

But now my DataGrid does not show the result in the right order.
It even shows different on refresh/reload?


regards,
Cor van Dooren


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
Andersson
Sent: donderdag 21 juli 2011 15:10
To: Flash Coders List
Subject: Re: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

Cor skriver:
 OK, so when I change the output line in my PHP from:
 print  $response;
 to
 print returnString=$response;

 So flash expects a key-value pair!!!


Now the real question is, why is Flash expecting that format to begin with?
You shouldn't change your php code. You should change the actionscript code.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Incorrect XML from PHP to Flash {RESOLVED}

2011-07-21 Thread Henrik Andersson

Cor skriver:

Thank you.

I have:
var myXML:XML =  XML(e.target.data.returnString);


You should have XML(loader.data).
Use the URLLoaderDataFormat.TEXT mode, not the 
URLLoaderDataFormat.VARIABLES mode.


As for the ordering, did you request any specific order at any time in 
the chain? You did not in the sql query, you did not attempt to reorder 
things in php and you did not attempt to reorder things in actionscript.


Ask for the items in the table in a specific order in the sql query.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders