Current location: Hot Scripts Forums » Programming Languages » PHP » my sql php and flash


my sql php and flash

Reply
  #1 (permalink)  
Old 09-24-09, 06:59 AM
__md__ __md__ is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
my sql php and flash

Does anyone have knowledge of my sql php flash integration?
Reply With Quote
  #2 (permalink)  
Old 09-24-09, 07:12 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Vague questions like this are not going to get you any useful answers.
Reply With Quote
  #3 (permalink)  
Old 09-24-09, 07:21 AM
__md__ __md__ is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
sorry basically I am creating a user registration which is displayed in flash and is linked with mysql database and php files , when I run the swf file I do not get the feedback im supposed to get telling me I am now regged the code on the flash buttons(actionscript) have no errors so it maybe something to do with the mysql database but I have no idea what it could be....
Reply With Quote
  #4 (permalink)  
Old 09-24-09, 01:13 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Please post your code.
Reply With Quote
  #5 (permalink)  
Old 09-24-09, 04:00 PM
__md__ __md__ is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
thank you

this is the code for the flash(actionscript) login button
Code:
on (release) {
if (username != "" && pass != "") {
	loadVariablesNum("login.php", 0, "POST");
	words="Processing..."
           }else{
    _root.words = "Please enter a username and password";
	       }
}
the is the code for the register flash (actionscript) button
Code:
on (release) {
     if(username.length >= 6 && pass.length >= 6){
		loadVariablesNum("register.php", 0, "POST");
		words="Processing..."
		
	 }else{
		_root.words = "Username must have between 6 and 12 characters.";
	}
}
the register php file
PHP Code:

<?php 

mysql_connect
("localhost","root","") or die(); 
mysql_select_db("dm") or die();  

$usercheck $_POST['username'];
$check mysql_query("SELECT username FROM users WHERE username = '$usercheck'"
or die();

$check2 mysql_num_rows($check);
if (
$check2 != 0) {
print 
"words=Username already exists.&checklog=1";
die();
}

$insert "INSERT INTO users3 (username, password)
VALUES ('"
.$_POST['username']."', '".$_POST['pass']."')";
$add_member mysql_query($insert);
print 
"words=You are registered.&checklog=2";
die();
?>

the login php file

<?php 
mysql_connect
("localhost","root","") or die(); 
mysql_select_db("rr") or die(); 

$check mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."'")or die();

$check2 mysql_num_rows($check);
if (
$check2 == 0) {
print 
"words=User doesn't exist.&checklog=3";
die();
}
while(
$info mysql_fetch_array$check )) 
{

if (
$_POST['pass'] != $info['password']) {
print 
"words=Incorrect Password.&checklog=4";
die();
}else 

print 
"words=You are logged in.&checklog=5";
die();



?>
and if its any help the tutorial which i got it from
Flash Kit, A Flash Developer Resource for Macromedia Flash 8 and MX Tutorials SWF FLA images clipart Sounds WAVS Animations Help and Support

Last edited by wirehopper; 09-24-09 at 08:09 PM. Reason: Code & PHP tags
Reply With Quote
  #6 (permalink)  
Old 09-24-09, 08:31 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Put a message in the die() calls - such as die('Could not connect'), die('Could not select').

That will help you see where the problem is.
Reply With Quote
  #7 (permalink)  
Old 09-26-09, 05:58 AM
__md__ __md__ is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
nope still did not make a difference
Reply With Quote
  #8 (permalink)  
Old 09-27-09, 03:06 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
What did it do?

If I were you, I'd put an echo after every statement until I could identify the line that was causing the script to fail.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Flash, XML, PHP punky79 Flash & ActionScript 2 04-03-08 02:55 PM
flash to php feffik PHP 6 03-26-05 12:15 PM
flash mx to PHP to flash mx olm75 PHP 1 12-09-04 03:44 AM
Php with flash or without tables ? EraseR PHP 0 06-26-04 07:36 AM


All times are GMT -5. The time now is 08:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.