-
getURL(problem)
I have a large dynamic text that is formated inside of flash (new lines, bold text ect).
I am trying to post that information to a website using geturl(). Is there any way to make newlines in a posted url??
I can have the dynamic text posted either as html or plain text (it is formated and displayed in flash as html) however, If I post the html, the browser reads the varriables as html and displays all the html tags. If I post it as plain text, it displays one long string.
the posted variables are being handled via php.
-
try using <br> or newline
-
The problem stems from how the URL is parsed by the webserver... I ran into a similar problem doing long SQL statements ina URL to be parsed by a cgiscript... someone sent me this list of codes to replace characters that the webserver can't deal with:
For example:
Code:
(hello world) would be %28hello%20world%29
Code:
Character Replace With
= %3D
' %27
( %28
) %29
space %20
Unfortunately I don't have a newline character - just what you see here, but maybe it will give you enough to search the web for a more complete list...
Sorry I couldn't be more help...
-DM
-
Hi,
if you see html cides on a website, probably something is changing the < > into < and >
if you accept plaintext from flash, line returns are of the \r variety - you may want to str_replace them into \n in your php script:
$text = str_replace("\r", "\n", $text);
Musicman
-
I may have misunderstood the problem, but I thought the idea was to pass a URL that contains additional information using getURL() - In other words a text string that would work if you dumped it in the "Address" bar of your browser...
Does the \x notation work in a URL? I know the &xxx and the hex characters work...
There's a whole list of acceptable characters in the HTML Master Reference (IDG Books) in Appendix C...
-DM
-
Hi,
the idea is correct, and some variations take care of the encoding for you:
getURL with the variable in the same timeline and GET option
loadvars.send with the variable specified amd GET option.
Adding the string yourself means that you need to escape it before (this will use the %26 etc codes)
Your php will automatically decode this. After that (in your php) you can change line endings the way you want them.
Musicman
-
I've used an actionscript function in the past to urlencode text passing to and from external data sources -I think I originally found it on flashkit!
I'm not 100% clear now as the fla file is at home 30 miles away but i seem to remember its something like this
Using html enabled input area called "MyTextfield" and
Variable to send called "varToSend"
when making the GEt or POST url call format the string using
varToSend = encode(MyTextfield);
And to redisplay URLencoded input from server / external source use
MyTextfield = decode(varReceived);
Try checking them in an AS dictionary - but as far as I can remember thats it.