Link to home
Start Free TrialLog in
Avatar of Hube02
Hube02Flag for United States of America

asked on

Using Flash to Submit to PHP

I am trying to use a flash form to submit to a PHP script.

I've followed a simple tutorial where I add a text box and a button.

The text box is set to Input Text and on the button I have the following script:

on(release) {
      getURL('test.php', '', 'POST');
}

All seems to be working except that when I do a print_r($_POST); I get the following:

Array
(
    [q] => <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">fdsafdsafdsa</FONT></P></TEXTFORMAT>
)

Is there any way to get the data that is in the flash var without all this other crap or must I now parse this with php to get the value that I'm looking for?
SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Hube02

ASKER

Changing my line with getURL() to the above appears to do nothing at all.

I need this to work just like a normal form with the action of "test.php" an the method of "post" where the broswer goes to that URL and that url process the from and then displays some output.

As I said, I'm following the tutorials I've found and they all use the getURL() function and none of them say anything about getting past an XML string of junk.
Avatar of Hube02

ASKER

Well, this is what I did...

The instance name of my text field is "SearchTerm"

I changed my script to the following:

on(release) {
      var q:String = SearchTerm.text;
      getURL('test.php', '', 'POST');
}

Other than this everything else is the same as ALL the tutorials that I've found. You'd think that they would not miss this simple step in a tutorial or to at least tell you in the tutorial that what you really get is all the formatting of a text field if you don't do something to change it.

My question is, why would they think we'd want all that crap to begin with?

Anyway, problem solved
It probably is the case where the tutorials are dealing with the regular textField but you are dealing with the HTML enabled textField...

At any rate, the purpose of the tutorial is that you learn specific item in a quick manner...  You should not rely on those because there are many that are written poorly...  I'd stick with the Flash manual to learn the specific stuff...  I've got to admit that Flash manual is not the most intuitive material you can study, but it's got vast information that's viable to survive in this AS world...  ;)

At any rate, glad to hear that you've got it sorted out...  ;)

CyanBlue
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial