[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.7

What's the best/simplest way to access a secure page in Flash with a user name

Asked by rondfranks in PHP Scripting Language, Adobe Flash, ActionScript

Tags: Flash, PHP

What's the best/simplest way to access a secure page in Flash with a user name & password using PHP?

I've tried to make a login page with PHP but have not been successful.

I've tried several different variations of code, but the one's I've attached seem to come closest to working.

Unfortunately, it only returns that the user name is wrong, even though it is not.

Any ideas about what is not working?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
//attached to button
on (release, keyPress "<Enter>") {
	login(user, pass);
}
 
//on timeline
function login(user, pass) {
	//create a new LoadVars Object
	myvars = new LoadVars();
	//set variables in that object
	myvars.user = user;
	myvars.pass = pass;
	//When you receive data back, execute the function action ()
	myvars.onLoad = action;
	//Send the variables and wait for the response
	//The random fake variable is attached to prevent caching the response data
	myvars.sendAndLoad("secure_login.php?random="+new Date().getTime(), myvars);
}
function action() {
	//Check the response
	if (myvars.response == "ok") {
		//if the response was "ok", proceed to the secured area
		status = "Welcome, "+user;
		gotoAndStop("secure");
	} else {
		// else show the error status
		status = myvars.response;
	}
}
 
//PHP script
<?php
 
// SET THE CORRECT USERNAME AND PASSWORD
$correct_user = "myusername";
$correct_pass = "mypassword";
 
// Checkif the username is correct
if ($user==$correct_user){
 
	//IF the username is correct, check the password
	if ($pass==$correct_pass){
 
		//If the password is correct, return "ok"
		$response="ok";
 
	} else {
 
		//Else the password is wrong
		$response="Wrong password";
	}
 
} else {
 
	//If the username is wrong
	$response="Wrong username";
}
 
//Return the response to Flash
print "&response=".$response."&";
 
?>
 
Related Solutions
Keywords: What's the best/simplest way to ac…
 
Loading Advertisement...
 
[+][-]01/05/09 01:04 AM, ID: 23293874Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 03:51 AM, ID: 23294547Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 01:07 PM, ID: 23299201Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 01:40 PM, ID: 23299560Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 01:52 PM, ID: 23299688Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 03:04 PM, ID: 23300315Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 03:28 PM, ID: 23300447Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 08:15 PM, ID: 23301851Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 11:56 PM, ID: 23302499Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP Scripting Language, Adobe Flash, ActionScript
Tags: Flash, PHP
Sign Up Now!
Solution Provided By: nizsmo
Participating Experts: 1
Solution Grade: A
 
[+][-]01/06/09 04:17 AM, ID: 23303582Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/06/09 01:37 PM, ID: 23309639Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_Related_20080208