Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8596537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:42:12+00:00 2026-06-12T00:42:12+00:00

I know this question has been asked before, but I’ve had little success even

  • 0

I know this question has been asked before, but I’ve had little success even after visiting similar questions. I’m currently developing a Flash project which involves being able to create an account and log in. However, I keep getting “undefined” from my attempts to parse PHP output.

Here is my ActionScript 3.0 code for the function that contains the code.

function gosubmit(event:MouseEvent) {
    if (username.text != "" && password.text != "") {
        var phpVars:URLVariables = new URLVariables();
        var phpFileRequest:URLRequest = new URLRequest();
        phpFileRequest.url = "php/controlpanel.php";
        phpFileRequest.method = URLRequestMethod.POST;
        phpFileRequest.data = phpVars;

        var phpLoader:URLLoader = new URLLoader();
        phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
        phpLoader.addEventListener(Event.COMPLETE, execResult);

        phpVars.username = username.text;
        phpVars.password = password.text;

        phpLoader.load(phpFileRequest);
        phpLoader.addEventListener(Event.COMPLETE, execResult);

        function execResult(event:Event) {
            trace(event.target.data.execResult);
        }
    }

Here is the PHP code in php/controlpanel.php.

<?php

mysql_connect("localhost", "root", "password");
// change localhost to something else later
// change password to something else later
mysql_select_db("game");

$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$salt_mysql = mysql_query("SELECT salt FROM players WHERE username='".$username."'"); 
$salt = salt_row["salt"];    

$unhashed_password = $password.$salt;
$password = hash("SHA256", $unhashed_password); 

$exec_mysql = mysql_query("SELECT * FROM players WHERE username='".$username."' AND password='".$password."'");

if (mysql_num_rows($exec_mysql)) == 1 {
    echo "execResult=login_accepted";
}

if (mysql_num_rows($exec_mysql)) == 0 {
    echo "execResult=login_rejected";
}

else {
    echo "execResult=error";
}

?>

I have compared my code with multiple sources, even copied whole projects from sources trying to figure out what I have done wrong, but with little success. However, there is something weird I found out. Out of pure experimentation, I put the following into controlpanel.php:

=&execResult=test

And, instead of getting “undefined”, I got “test”. The weird part is that I only used that one line of code; no <?php tags or anything. Moreover, if I put more code beyond that, regardless of what kind of code I entered, it would always show up literally in the Flash output. So I can now hardcode a value and return it into Flash, but that’s not what I need. I need to be able to determine a value based on conditionals and have it automatically returned into Flash.

Can anyone help me out? I am truly stumped.

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:42:14+00:00Added an answer on June 12, 2026 at 12:42 am

    Seems that you are executing flash from the editor/debugger, (if you are checking the results with trace function).

    Then using a relative url for request “php/controlpanel.php” is like opening the file localy without the execution from server of php directives.

    Maybe thats why you get literaly all php code, or the correct value when you only put “=&execResult=test” as the content of the php file.

    Try using absolute url with the http:// in order to perform an http request where server and php execution are involved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked before numorous times but they seem to
I know this question has been asked before, but non of the solutions solve
I know this question has been asked before, but I haven't been able to
Yes, I know this question has been asked before, but I can't find an
Alright, I know this question has been asked before, but mine has a different
I know this type of question has been asked and answered before but I
I know that this sort of question has been asked here before, but still
I know this question has been asked before, but none of the previous answers
I know this question has been asked here before, but I don't think those
I know this sort of question has been asked before , but I still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.