PDA

View Full Version : URL Encoding (Confused)



waffe
January 23rd, 2003, 12:18 AM
I am sending a string to asp from flash that looks like this;
&profileID=0jt3f1g10jt3f1g11wt6q1d00jt3f1g1
&profileID=0jt3f1g10jt3f1g11wt6q1d010qxs1m0
&profileID=0jt3f1g10jt3f1g11wt6q1d00fln71v1

The problem is when asp (probably php too) reads this string, it reads it like this

%26profileID%3D0jt3f1g10jt3f1g11wt6q1d00jt3f1g1 %26profileID%3D0jt3f1g10jt3f1g11wt6q1d010qxs1m0 %26profileID%3D0jt3f1g10jt3f1g11wt6q1d00fln71v1

Now this sucks, is there a way to encrypt my flash string so asp will read the string corectly?

I know asp is url encoding the flash string, but this bit of info does not seem to help.

Can YOU!!!:hangover:

pom
January 23rd, 2003, 08:16 AM
Use unescape on that string.

pom :ninja:

babbaladoobala
January 23rd, 2003, 12:18 PM
I am curious about this issue as well.

If I am posting a similiar string to an .asp file, would I use the unescape command in flash before the data is posted? Or does the unescape command go somewhere in the .asp file?

waffe
January 23rd, 2003, 03:24 PM
I believe ilyaslamasse means to put unescape in the flash A.S. string I am passing to asp, but this does not seem to fix the problem.

waffe
January 24th, 2003, 02:21 PM
I think Load vars will solve my problem but I am having trouble using the send function of loadvars. Help Help.

H88 did you post a response to this thread because I can't find it

h88
January 24th, 2003, 02:25 PM
well let us see, how are you calling the send function, are you posting data to a php(or whatever), and or getting a response? or your trying to get a data from a php script normally without posting any vars.

waffe
January 24th, 2003, 03:20 PM
I am trying to send to ASP Like this

profileID = new LoadVars();
profileID += "&"+_root.player.listbox.getSelectedItem().data["ID"]
profileID.send("..playlist.asp", "_self", "POST");

h88
January 24th, 2003, 03:26 PM
profileID = new LoadVars();
profileID.Variable = "&"+_root.player.listbox.getSelectedItem().data["ID"]
profileID.send("..playlist.asp", "_self", "POST");

Where "Variable" is the variable being posted to the asp script, i hope you get the idea.

waffe
January 24th, 2003, 03:51 PM
I had to change "Variable" to profileID because that is the Variable being posted to the asp script.

It is sending to asp know but the string I send it is still turning the "&" into %26.

I thought load Vars would solve this problem?

Any Ideas.
:q:

h88
January 24th, 2003, 03:55 PM
Well that's weired, why do you actually need to post '&'?

Did you try?

profileID.Variable = unescape("&")+_root.player.listbox.getSelectedItem().data["ID"]

Well now that sound dump, because it's actually already unescaped....

waffe
January 24th, 2003, 04:04 PM
I need the "&" because the string sent by flash is multiple vaules seperated by "&", so when asp reads the string it will look like this; &Value1&Value2&Value3 ect...

And yes, I tried the unescape command and no luck, the string is still being encoded.

There must be a way!!!!!

:(

h88
January 24th, 2003, 04:07 PM
Originally posted by waffe
I need the "&" because the string sent by flash is multiple vaules seperated by "&", so when asp reads the string it will look like this; &Value1&Value2&Value3 ect...

I never worked with asp, but can't you just say:

Document.print.... "&"+ImportedVar1+"&"+ImportedVar2

Edit: you might want to Ask Rev if you want any asp help, he knows it i think.

waffe
January 24th, 2003, 04:34 PM
I can't do that because the number of values are dynamic, meaning they change for one user to the next.

I don't really think it is an ASP problem. URL encoding happens when you pass data though the html headers, so regardless of what program I'm sending to the data is going to be encoded.

I am not working with the asp script, nor do I know much about it.
I am the flash guy on a project working with an ASP guy.:hat:
I have asked the ASP guy the same question of "why can't you fix the string problem on your end", and he says "he can't" because of certain guide lines I don't under stand.

Crazy, there are 3 programs myself, and now you that can't find the answer to this question.

I'm fallen apart here!

:hair:

Thanks for the load Vars help

h88
January 24th, 2003, 04:42 PM
Hmm,

profileID = new LoadVars();
profileID.Variable = unescape("%26")+_root.player.listbox.getSelectedItem().data["ID"]
profileID.send("..playlist.asp", "_self", "POST");

waffe
January 24th, 2003, 04:51 PM
I tried all the variation, escape, unescape, "&", "%26".

Nada

abzoid
January 24th, 2003, 06:02 PM
g'afternoon, let me first introduce myself. I'm abzoid, rev flash's brother.

I'm not a Flash guy, but I am an ASP programmer. It should be relatively easy for the ASP programmer that your working with to use the replace command on an intermdiate ASP page to parse the parameter string. The coding would look something like this, assuming he's using VBScript. You'd pass the existing string to this intermediate page where it would be parsed into the proper format then passed on to the intended page.


paramStr = Request.Form
paramStr = Replace(paramStr,"%26","&")
paramStr = Replace(paramStr,"%3D","=")

Response.Redirect ("..playlist.asp?" + paramStr)


abzoid :geek:

waffe
January 24th, 2003, 06:11 PM
Thanks abzoid,

I just sent him your respones. I'll let ya know what he says.

;)

pom
January 24th, 2003, 09:30 PM
Originally posted by abzoid
I'm abzoid, rev flash's brother.Welcome man :trout:

reverendflash
January 24th, 2003, 09:46 PM
Be afraid... be very afraid...

Abzoid is lurking...

:evil: :skull: :ninja:

:love:

Revhttp://www.aulman.com/rev.gif

abzoid
January 25th, 2003, 01:46 AM
Thank ilya 8]

Hey Bro, 'sup? :cool: :P

reverendflash
January 25th, 2003, 02:21 AM
Just a thought...

We may be the first brothers to sign up for this forum...

Maybe the Big K will see this, or lost maybe they'd know...

let me know if you want a footer... :rambo:

and... http://www.bbcamerica.com/images/genre/comedy_games/monty_python/spam_gallery/spam_cutler_jack.jpg

Revhttp://www.aulman.com/rev.gif

h88
January 25th, 2003, 01:17 PM
Hey did you call your brother to join us here? Welcome!

reverendflash
January 25th, 2003, 01:48 PM
h88:

nope, he joined all on his own...

He's a great resource for ASP...Rev

http://www.aulman.com/rev.gif

h88
January 25th, 2003, 02:43 PM
I still don't understand why people choose proprietary solutions like CF and ASP when there is a top-of-the-line product like PHP out.

abzoid
January 25th, 2003, 02:52 PM
Y'know, that's why they have horse races. Differences in opinion. ;)


Originally posted by h88
I still don't understand why people choose proprietary solutions like CF and ASP when there is a top-of-the-line product like PHP out.

reverendflash
January 25th, 2003, 03:26 PM
h88:

have you ever been able to get a php page to display on a browser?

asp can...

plus other reasons... life is not black and white... and there are many ways to get to the same result... each has its own values...

Revhttp://www.aulman.com/rev.gif

h88
January 25th, 2003, 04:12 PM
Originally posted by reverendflash
h88:

have you ever been able to get a php page to display on a browser?

asp can...

plus other reasons... life is not black and white... and there are many ways to get to the same result... each has its own values...

Revhttp://www.aulman.com/rev.gif

http://www.php.net/manual/en/faq.languages.php

abzoid
January 25th, 2003, 05:00 PM
ASP, CF and PHP each have their +'s and -'s. Anyone that regularly works with database driven web sites should at least be familiar with all three. I learned ASP first, because that was what was supported by Dreamweaver at the time. I've been learning CF, since Macromedia seems to be leaning that direction since the purchase if Allaire. PHP is on my short list, but I've helped debug a few things in PHP for a friend and have picked up a few of the basics already.

My computer science degree is BPC (before personal computers) so I'm self-taught on everything web related. My background with structured programming has made learning HTML, ASP, etc. much easier.

Bottom line, it's the needs and existing resources of the client that usually determines which database and server side language they go with. That ol' "real world" thang rearing it's ugly head again. =)

waffe
January 27th, 2003, 02:06 PM
OK, I don't know much about all three, but this is the how the story went. After I received abzoid response, I E-mailed my asp guy, by then he contacted another flash guy and they came up with a working result that went something like this.

On the flash side;

profileID = new Array();
for (i=0; i<_root.player.listbox.getLength(); i++) {

_root.player.listbox.getSelectedItem().data["ID"] var k = _root.player.listbox.getItemAt(i).data;
thisID = k.ID;
profileID.push(thisID);

On the ASP side, he chanced his delineator to "," instead of "&",
and all is working fine.

So, the way they made it happen, it seems both flash and ASP had to change alittle.

Thanks to h88, abzoid, and of course, Kirupa.com for kicken *** once again.

Peace.

:love: