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

  • Home
  • SEARCH
  • 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 8982583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:36:53+00:00 2026-06-15T20:36:53+00:00

I am trying to create a user log-in system in Flash but I need

  • 0

I am trying to create a user log-in system in Flash but I need to communicate to MySQL through PHP in order to do so. I looked around at a few tutorials, but I have been getting errors.

Here is the interface I have made in flash, which I am trying to communicate with controlpanel.php

https://i.stack.imgur.com/eB3C7.png

Here is the code

AS file

package actions
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.URLLoader;
    import flash.events.Event;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequestMethod;
    import flash.text.TextFieldAutoSize;

    public class main extends MovieClip
    {
        public function main():void
        {
            submit_button.buttonMode = true;
            submit_button.addEventListener(MouseEvent.MOUSE_DOWN, checkLogin)

            username.text = "";
            password.text = "";
        }

        public function checkLogin(e:MouseEvent):void
        {
            if(username.text==""||password.text=="")
            {
                if (username.text == "")
                {
                    username.text = "Enter your username";      
                }

                if (password.text == "")
                {
                    password.text="Enter your password";
                }
            }
            else
            {
                processLogin();
            }
        }

        public function processLogin():void
        {
            var phpVars:URLVariables = new URLVariables();
            var phpFileRequest:URLRequest = new URLRequest("http://mathlympics.cu.cc/php/controlpanel.php");
            phpFileRequest.method = URLRequestMethod.POST;
            phpFileRequest.data = phpVars;

            var phpLoader:URLLoader=new URLLoader();
            phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

            phpVars.systemCall = "checkLogin";
            phpVars.username = username.text;
            phpVars.password = password.text;

            phpLoader.load(phpFileRequest);
            phpLoader.addEventListener(Event.COMPLETE, showResult);
        }

        public function showResult(event:Event):void
        {
            result_text.autoSize = TextFieldAutoSize.LEFT;
            result_text.text = ""+ event.target.data.systemResult;
        }
    }
}

PHP file – connect.php

<?php
$db_username = "censored";
$db_name = "censored";
$db_password = "censored";
$db_host = "mysql2.000webhost.com";
mysql_connect($db_host,$db_username, $db_password, $db_name);
mysql_select_db($db_name) or die (mysql_error());
?>

PHP file – controlpanel.php

   <?php
error_reporting(E_ALL);
include_once("connect.php");
$username       = "admin";
$password       = "password";
$sql            = "SELECT * FROM user WHERE username='$username' AND password='$password'";
$query          = mysql_query($sql);
$login_counter  = mysql_num_rows($query);
if ($login_counter > 0)
{
    $data       = mysql_fetch_array($query);
    $userbio    = $data["user_bio"];
    echo "systemResult=" . $userbio;
}
else
{
    echo "systemResult=Invalid";    
}
?>

I do not get any error but when I press the submit button, is says undefined in the result text box, even when I type the right username and password.

<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->

To those of you interested: Here is my website enter link description here

  • 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-15T20:36:54+00:00Added an answer on June 15, 2026 at 8:36 pm

    So the problem ended up being you had SELECT * FROM user... when it should have been SELECT * FROM users... =)

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

Sidebar

Related Questions

I am trying to create an automated log in system with cakePHP and need
I am trying to create a log in system in php. I have 3
In a view I'm trying to create a new user and then log them
I am trying to create a php file that adds a user and create
For a project we have to create a basic log in system. Im trying
I am trying to make a safe, custom, user login system, but it currently
I'm trying to create user profiles for my site where the URL is something
I'm trying to create User Control which will work like a rich button. It's
Im trying to create a user control menu where links to a page's usercontrols
I'm trying to create a User Registration page in ASP.NET and wondering what is

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.