Thanks Karl,

stripslashes crashes the application.
It goes wrong on name-value pair in the URLVariables.

I use characters like ë, é, etc.
My textfields render as HTML and everything works as I expected.
But, I also use the Datagrid component and in there these is shown like
ë

Yes, I know, don't use components...
But the harm is done and I can't go back.

Regards
Cor


-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: dinsdag 7 augustus 2012 4:19
To: Flash Coders List
Subject: Re: [Flashcoders] HTML in Datagrid component

try this.

function stringToMysqlFormat($original_input) {
              //for inserting the data INTO mysql
              $original_input = stripslashes($original_input);
              $string = mysql_real_escape_string($original_input);
              return $string;
}

function mysqlToHTMLFormat($encoded) {
              //for displaying the data FROM mysql
              $html = htmlspecialchars($encoded);
              return $html;
}


On Aug 6, 2012, at 6:15 PM, Karl DeSaulniers wrote:

> Yes and no.
> That is your SQL insert statement, which is good to know, but I was 
> referring to the value of $original_input.
> Or is that statement the value of $original_input?
>
> What has the html special characters in it?
>
> Best,
> Karl
>
>
> On Aug 6, 2012, at 3:39 PM, Cor wrote:
>
>> Does this hel:
>>
>> INSERT INTO `tbl_projecten` (`project_nummer`, `project_werk`, 
>> `project_betreft`, `project_datum`, `project_klantnummer`, 
>> `project_ordernummer_klant`, `project_contactpersoon`, 
>> `project_opdracht`, `project_aanneemsom`, `project_conform`, 
>> `project_besteldatum`, `project_BTW`, `project_betaling_binnen`, 
>> `project_kleuren`,
>> `project_rekeningtekst`) VALUES
>> (1, 'Entree', 'Aanbrengen van glasweefsel en het sausen daarvan', 
>> '19-11-2011', 24, '0005873-0016178', '', 'order', '5.953,44', 
>> 'bestelling',
>> '11 november 2011', '19', '14', '', '');
>>
>>
>> -----Original Message-----
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl 
>> DeSaulniers
>> Sent: maandag 6 augustus 2012 22:02
>> To: Flash Coders List
>> Subject: Re: [Flashcoders] HTML in Datagrid component
>>
>> Can you post what some data looks like before you put it into mysql?
>>
>>
>> On Aug 6, 2012, at 8:52 AM, Cor wrote:
>>
>>> Hi All,
>>>
>>> I am having a problem with loading data correctly in my Datagrid.
>>>
>>> User input data is stored in MySQL through PHP with these functions:
>>>
>>> function stringToMysqlFormat($original_input) {
>>>              //for inserting the data with special characters INTO 
>>> mysql
>>>              $html_encoded =
>>> htmlentities(mysql_real_escape_string($original_input));
>>>              return $html_encoded;
>>> }
>>> function mysqlToHTMLFormat($encoded) {
>>>              //for displaying the data FROM mysql
>>>              $html_decoded =
>>> html_entity_decode(stripslashes($encoded));
>>>              return $html_decoded;
>>> }
>>>
>>> It works OK in all the textfields, but not in my Datagrid.
>>> Then it shows like the HTML formatted way: Ã etc.
>>>
>>> How to solve this?
>>>
>>>
>>> Best regards,
>>> Cor van Dooren
>>>
>>> _______________________________________________
>>> 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
>>
>>
>> -----
>> No virus found in this message.
>> Checked by AVG - www.avg.com
>> Version: 2012.0.2197 / Virus Database: 2437/5181 - Release Date:  
>> 08/06/12
>>
>> _______________________________________________
>> 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

Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2197 / Virus Database: 2437/5183 - Release Date: 08/07/12


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

Reply via email to