Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS3 Login - no submission

Status
Not open for further replies.

DaSe

Programmer
Feb 14, 2008
149
0
0
GB
Hello masters again...
This time I really need to refer to your knowledge. Hopefully I'll sort it out. The reason:

I am testing a login.php page locally ( the servers are working fine and all the services are fine as well inlcuding proper '$_POST' posting ). I have written a small Flash registration in AS3 and the registration submits everything to database without a slightest problem. The problem is ( I've been trying to sort it out for almost 2 days ) is that I wrote another small Flash file in AS3 - login this time. A simple "username" and "password" flash file. And it when you submit button it just doesn't do anything...I am positive login.php is receiving the variables from Flash. When user ( for example ) presses the button it should be redirected to another page when username is correct. I really don't know what I'm doing wrong...so any comments would be helpful...

Code:
Flash AS3:
=====
logBtn.addEventListener(MouseEvent.CLICK, regForm);

function regForm(event:MouseEvent):void

{
	
var request:URLRequest = new URLRequest ("login.php"); 
request.method = URLRequestMethod.POST; 
	
	
var variables:URLVariables = new URLVariables(); 
                 
variables.uNameL = userNameLog.text; 
variables.uPassL = userPasswordLog.text;





            
request.data = variables; 
var loader:URLLoader = new URLLoader (request); 
loader.addEventListener(Event.COMPLETE, regForm); 
loader.dataFormat = URLLoaderDataFormat.VARIABLES; 
loader.load(request); 


}

and login.php

Code:
login.php:
==========
require("connections/conn.php");
$uNameL = trim($_POST['uNameL']);
$uPassL = trim($_POST['uPassL']);
$uPassL = md5($_POST['uPass']);
$selection = mysql_query("SELECT * FROM `auth` WHERE `userName`='$uName' AND `userPassword`='$uPassL'");
//$login_check = mysql_num_rows($selection);
while($row = mysql_fetch_array($selection))
{ extract($row); 
$id = $row['uid']; 
$uNameDb = $row['userName']; 
$uPassDb = $row['userPassword']; 
}

if ($uNameL == $uNameDb) {  header("Location: index.php"); exit();}

/*
if($login_check > 0){ 

   while($row = mysql_fetch_array($selection)){ 
	
	header("index.php"); exit(); 
	} */

Thank you....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top