PDA

View Full Version : Something wrong with passing newline character through variable in remoting call?


honers
02-15-2005, 01:22 AM
I am having a wierd problem when i try to pass a newline (\n) character in a variable to a remoting service.

I am doing a basic email function as part of a larger database project where flash passes some dynamic content to the service and a text email is sent.

Here is what works fine: The variables are all passed and the email is sent.
BUT something seems to happen to the newline characters in the process.

The line breaks read fine in the flash preview window I created, HOWEVER

When I check the email on certain services (yahoo mail, vircom) the email is just one big paragraph without the line breaks.

BUT, on other services like aol.com and in my Entourage & Outlook, as well as a friend's web VPN, everything is fine.

ALSO, if I append some text with line breaks created in the PHP code, the line breaks are read correctly for that text and not for the text which comes from the Flash variable.

I think I have narrowed down that the problem happens when the variable is sent from flash and recieved by my PHP service (using AMFPHP).

Any ideas what could be causing this and how I could correct the problem so that I can be compatible with a larger set of web based email accounts.

Thanks for the help,

Kevin

grass
06-27-2006, 02:36 PM
hi,

just had the same problem and as i had researched it for like 10hours or so - i just went second way....

output="";
for(i=0;0<input.text.length;i++) {
if(input.text.charCodeAt(i)!=13) {
output+=input.text.charAt(i);
} else {
output+="<br>";
};
};

like this u get basic html text.... then post it as u like.... send(), sendandload() or getURL().... end add to your mail form this thing:

$teema = "From:klient<[email protected]>\r\nContent-type: text/html; charset=iso-8859-15";
mail("[email protected]", "feedback" , $output, $teema);

atleast something like that....
this way it sends basicly html e-mail....
hope thet helped u....
ohyeah - another thing - as u just need to send some script text with non-unicode characters and enable all ':;.,- usw...
i figured it'd be best to save stuff as charCodes.... atleast as i create dynamic flashsites, thats the way i do it....
for instance:

output="";
for(i=0;0<input.text.length;i++) {
output+=input.text.charCodeAt(i);
};

grass
06-27-2006, 02:36 PM
hi,

just had the same problem and as i had researched it for like 10hours or so - i just went second way....

output="";
for(i=0;0<input.text.length;i++) {
if(input.text.charCodeAt(i)!=13) {
output+=input.text.charAt(i);
} else {
output+="<br>";
};
};

like this u get basic html text.... then post it as u like.... send(), sendandload() or getURL().... end add to your mail form this thing:

$teema = "From:klient<[email protected]>\r\nContent-type: text/html; charset=iso-8859-15";
mail("[email protected]", "feedback" , $output, $teema);

atleast something like that....
this way it sends basicly html e-mail....
hope thet helped u....
ohyeah - another thing - as u just need to send some script text with non-unicode characters and enable all ':;.,- usw...
i figured it'd be best to save stuff as charCodes.... atleast as i create dynamic flashsites, thats the way i do it....
for instance:

output="";
for(i=0;0<input.text.length;i++) {
output+=input.text.charCodeAt(i);
};

grass
06-27-2006, 02:36 PM
hi,

just had the same problem and as i had researched it for like 10hours or so - i just went second way....

output="";
for(i=0;0<input.text.length;i++) {
if(input.text.charCodeAt(i)!=13) {
output+=input.text.charAt(i);
} else {
output+="<br>";
};
};

like this u get basic html text.... then post it as u like.... send(), sendandload() or getURL().... end add to your mail form this thing:

$teema = "From:klient<[email protected]>\r\nContent-type: text/html; charset=iso-8859-15";
mail("[email protected]", "feedback" , $output, $teema);

atleast something like that....
this way it sends basicly html e-mail....
hope thet helped u....
ohyeah - another thing - as u just need to send some script text with non-unicode characters and enable all ':;.,- usw...
i figured it'd be best to save stuff as charCodes.... atleast as i create dynamic flashsites, thats the way i do it....
for instance:

output="";
for(i=0;0<input.text.length;i++) {
output+=input.text.charCodeAt(i);
};