Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to test connection with php file.

Participant ,
Oct 13, 2013 Oct 13, 2013

public function processCreate():void {

            var urlVars:URLVariables = new URLVariables();

            

            var urlFileRequest:URLRequest = new URLRequest("php/controlpanel.php");

            

            urlFileRequest.method = URLRequestMethod.POST;

                        

            urlFileRequest.data = urlVars;

           

            var php2Loader:URLLoader = new URLLoader();

            php2Loader.dataFormat = URLLoaderDataFormat.VARIABLES; 

            php2Loader.addEventListener(Event.COMPLETE, showResult);

           

            urlVars.systemCall = "createprofile";

            urlVars.username = username.text;

            urlVars.password = password.text;

           

            

            php2Loader.load(phpFileRequest);

       

        }

This is my function on a .as file. I want send username and password to php to create a new user profile in mySQL.

I just copy/paste this code I don't know harp what am I doing, I want to do something simple, like trace, but to test the connection between flash and the php/controlpanel.php.

Before I go further adding more codes I want to test if 2 files are properly connected, how do I do that, thannk you.

TOPICS
ActionScript
606
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 13, 2013 Oct 13, 2013

The first thing you need to do is test using a server that supports php and place that php file on the server.

The next thing you'll need to do is fix the variable name you use to agree with what your code specifies up top...

php2Loader.load(urlFileRequest);

Confirming whether or not the connection worked can be managed with whatever your showResult function does.

Translate
LEGEND ,
Oct 13, 2013 Oct 13, 2013

The first thing you need to do is test using a server that supports php and place that php file on the server.

The next thing you'll need to do is fix the variable name you use to agree with what your code specifies up top...

php2Loader.load(urlFileRequest);

Confirming whether or not the connection worked can be managed with whatever your showResult function does.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 13, 2013 Oct 13, 2013
LATEST

Hi, Ned.

After I fixed urlFileRequest, showResult shows properly in the dynamic text box now, thanks a lot.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines