iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Flash Discussion Forum Flash design presents a limitless number of possibilities for your sites and designs. Discuss your Flash ideas, questions and issues here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-27-2005, 11:00 PM
WebProWorld New Member
 
Join Date: Jun 2004
Location: USA
Posts: 20
pbrollwitme RepRank 0
Default login problem

hey all,
I've got a problem that i can't seem to figure out. I have a login on my flash site that i'm workin on, everything works flawlessly, except that the movie won't advance when the php calls that it is a valid username and password.
This is on the first frame of my movie:
stop();
userinput.restrict="a-zA-Z0-9";
passinput.restrict="a-zA-Z0-9";

Selection.setFocus(userinput);
status="Enter your information and submit";
this.onEnterFrame = function () {
if(_root.checklog == 1){
_root.map.gotoAndPlay(2);
}
if(_root.checklog == 2){
_root.gotoAndPlay(3);
}
}

this is on my submit button:

//this will be the action to get your variables from the PHP
on (release, keyPress "<Enter>") {
//checks to see if there is something in both the name
//and password
if (user != "" && pass != "") {
_root.status = "Begin Login Process - Wait...";
//if you changed the php file name, change it here to!!
loadVariablesNum("login.php", 0, "POST");
}
}

this is my php:
<?


//connect to database
if ($user && $pass){
mysql_pconnect("localhost","myuser","mypassword") or die ("didn't connect to mysql");
mysql_select_db("mydatabase") or die ("no database");
//make query
$query = "SELECT * FROM users WHERE username = '$user' AND password = '$pass'";
$result = mysql_query( $query ) or die ("didn't query");

//see if there's an EXACT match
$num = mysql_num_rows( $result );
if ($num == 1){
print "status=You're in&checklog=1";
} else {
print "status=Sorry,wrong password!!&checklog=2";
}
}
?>

I have a feeling its related to the &checklog's position in the php...and how its called in the AS. I've tried several different things but they didn't work. Anyone have any ideas?
Thanks!
Reply With Quote
  #2 (permalink)  
Old 08-30-2005, 05:04 AM
WebProWorld New Member
 
Join Date: Jan 2004
Location: England
Posts: 12
andyj RepRank 0
Default

Are the passwords stored in MySql as encrypted PASSWORD format? If so the query should read:
$query = "SELECT * FROM users WHERE username = '$user' AND password = password('$pass')";

Andy J.
Reply With Quote
  #3 (permalink)  
Old 08-30-2005, 11:09 AM
SnerdeyWebs's Avatar
WebProWorld Veteran
 
Join Date: Jan 2005
Location: Austin, Texas
Posts: 637
SnerdeyWebs RepRank 3SnerdeyWebs RepRank 3
Default

What's the word on this issue - did you get it working? Could you also post the url for review of the error and I'm also interested in the function of this combination of flash, mysql and php.
__________________
20% Off Online Stores | Flash CMS | Blogs | Templates * Follow Our Twitter!
Online Since 2003 & TemplateMonster, Logos, Design Software, Custom Websites
Reply With Quote
  #4 (permalink)  
Old 08-30-2005, 07:55 PM
WebProWorld New Member
 
Join Date: Jun 2004
Location: USA
Posts: 20
pbrollwitme RepRank 0
Default

i'm still having the problem...i don't think the problem is with the php code above:
if ($num == 1){
print "status=You're in&checklog=1";
} else {
print "status=Sorry,wrong password!!&checklog=2";
}
because status shows up in a dynamic text box as "You're in" if the username and password are correct and "Sorry, wrong passsword!!" when they aren't. That part works great. The problem is that &checklog=1. I want flash to gotoAndPlay a different frame if checklog =1. But i can't get that to work. If the problem was with the code for checking the mysql database,then the if statement wouldn't work right? I don't have the site up yet because i'm stuck on this part! but as soon as it works i'll post the link.
Thanks!
Reply With Quote
  #5 (permalink)  
Old 08-30-2005, 08:15 PM
SnerdeyWebs's Avatar
WebProWorld Veteran
 
Join Date: Jan 2005
Location: Austin, Texas
Posts: 637
SnerdeyWebs RepRank 3SnerdeyWebs RepRank 3
Default

If I'm not mistaken.. this might be missing some server support to communicate with your site and database. Maybe you could place it in a beta page like.. yourdomain.com/beta/index.php?

It has to call your DB, User and PW so I'm thinking this might help with troubleshooting. At least in this format as our eyes are tied =)

Will have to think about this one a little bit more.
__________________
20% Off Online Stores | Flash CMS | Blogs | Templates * Follow Our Twitter!
Online Since 2003 & TemplateMonster, Logos, Design Software, Custom Websites
Reply With Quote
  #6 (permalink)  
Old 08-30-2005, 09:06 PM
WebProWorld New Member
 
Join Date: Jun 2004
Location: USA
Posts: 20
pbrollwitme RepRank 0
Default

so you are saying that in order for php to relay variables to flash, the flash has to be nested in that php page??
Reply With Quote
  #7 (permalink)  
Old 08-30-2005, 09:08 PM
WebProWorld New Member
 
Join Date: Jun 2004
Location: USA
Posts: 20
pbrollwitme RepRank 0
Default

so you are saying in order for php to pass variables to flash, they have to be nested in the same page?
Reply With Quote
  #8 (permalink)  
Old 09-01-2005, 06:46 PM
DrTandem1's Avatar
WebProWorld 1,000+ Club
 
Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,830
DrTandem1 RepRank 2
Default

Without seeing this, I would suspect that the breakdown occurs because the data being requested doesn't exist where the script is expecting it. To troubleshoot this, use some good ol' echo commands to see where it stops.
__________________
DrTandem's San Diego Web Page Design, drtandem.com
Reply With Quote
Reply

  WebProWorld > Site Design > Flash Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:43 PM.



Search Engine Optimization by vBSEO 3.3.0