| PHP & AS intergration URGETNT | |
|
|
Author | Message |
---|
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: PHP & AS intergration URGETNT Tue May 05, 2009 11:15 am | |
| Hi, I'm making a login. My code is correct but i get a response of incorrect details. | |
|
| |
Bod720 ActionScript Coder
Number of posts : 150 Age : 28 Location : United Kingdom Infractions : 0, Zilch, Zero, Zip Status : Alive. Not coding Club Waddles for a few days. Registration date : 2009-01-28
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 11:57 am | |
| | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:01 pm | |
| ok, i posted an kirupa forums and i got no answer, here is my very detailed post. I have set everything server side and flash side. But when i open my project it says login details incorect. Oh, im making a loginif you haven't worked it out. Here are the codes I used. Some parts are just comments when I copied it off the kirupa website. Action Script: 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 != "") { status = "Searching database... Please wait"; //if you changed the php file name, change it here to!! loadVariablesNum("klubkrab.netne.net/newlogin.php", 0, "POST"); } }
Frame stop(); //stops the movie on the login page userinput.restrict = "a-zA-Z0-9"; passinput.restrict = "a-zA-Z0-9"; //this will make it so the user can't use symbols //that could mess with your database Selection.setFocus(userinput); //this puts the cursor in the first box (thaks Kax!) status = "Enter your information and submit"; //this enters in directions in your textbox called status this.onEnterFrame = function() { if (_root.checklog == 1) { _root.gotoAndStop(2); } if (_root.checklog == 2) { _root.gotoAndStop(3); } }; //the onEnterFrame constantly checks to see if the PHP //script has sent the variable 'checklog' back to the //movie and directs the people accordingly
PHP: Php file (newlogin.php)
<? //this pulls the variables from the flash movie when the user //hits submit. Use this when your global variables are off. //I don't know how to toggle global variables, so I just put //it in all the time $user=$_POST['user']; $pass=$_POST['pass'];
//connect to database if ($user && $pass){ mysql_pconnect("mysql8.000webhost.com","a2387414_"user,pass"") or die ("didn't connect to mysql"); mysql_select_db("a2387414_kk") or die ("no database"); //make query $query = "SELECT * FROM auth WHERE username = '$user' AND userpassword = '$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=Thanks for testing our login&checklog=1"; } else { print "status=Incorrect details&checklog=2"; } } ?>
All the files are uploaded to my server. If you have a solution please, please tell me. I'm making a game and flash is running out of trial time. i took out my usernames and passwords | |
|
| |
Bod720 ActionScript Coder
Number of posts : 150 Age : 28 Location : United Kingdom Infractions : 0, Zilch, Zero, Zip Status : Alive. Not coding Club Waddles for a few days. Registration date : 2009-01-28
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:07 pm | |
| change this line: loadVariablesNum("klubkrab.netne.net/newlogin.php", 0, "POST"); to this: loadVariablesNum("http://klubkrab.netne.net/newlogin.php", 0, "POST"); | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:08 pm | |
| | |
|
| |
Bod720 ActionScript Coder
Number of posts : 150 Age : 28 Location : United Kingdom Infractions : 0, Zilch, Zero, Zip Status : Alive. Not coding Club Waddles for a few days. Registration date : 2009-01-28
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:10 pm | |
| This line: mysql_pconnect("mysql8.000webhost.com","a2387414_"user,pass"") or die ("didn't connect to mysql");
to this: mysql_connect("mysql8.000webhost.com","a2387414_","user,pass") or die ("didn't connect to mysql"); | |
|
| |
Bod720 ActionScript Coder
Number of posts : 150 Age : 28 Location : United Kingdom Infractions : 0, Zilch, Zero, Zip Status : Alive. Not coding Club Waddles for a few days. Registration date : 2009-01-28
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:33 pm | |
| why is this mysql8.000webhost.com a different place than you uploaded the php? | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:34 pm | |
| ok, ill try that. thanks for helping | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:34 pm | |
| oh, i'm told to use it by my host | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:37 pm | |
| well, thats what i was told but you can never trust my host as its free (i know, i have php and all the new web features for free) | |
|
| |
timelord14 Club Waddles Support
Number of posts : 143 Age : 25 Location : UK Status : Trying to save cw with snooper and taddle Registration date : 2009-02-01
| Subject: Re: PHP & AS intergration URGETNT Tue May 05, 2009 12:46 pm | |
| - Bod720 wrote:
- why is this mysql8.000webhost.com a different place than you uploaded the php?
Hey bod could u read me pm please | |
|
| |
Bod720 ActionScript Coder
Number of posts : 150 Age : 28 Location : United Kingdom Infractions : 0, Zilch, Zero, Zip Status : Alive. Not coding Club Waddles for a few days. Registration date : 2009-01-28
| Subject: Re: PHP & AS intergration URGETNT Wed May 06, 2009 11:49 am | |
| | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Wed May 06, 2009 12:04 pm | |
| | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Wed May 06, 2009 12:14 pm | |
| | |
|
| |
Rory ActionScript Coder
Number of posts : 1366 Age : 27 Location : India Status : Changed my name to Rory Registration date : 2009-02-06
| Subject: Re: PHP & AS intergration URGETNT Wed May 06, 2009 8:02 pm | |
| I can't understand anything! | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Thu May 07, 2009 1:15 am | |
| i can kinda understand, not much. I'm new to actionscript | |
|
| |
Rory ActionScript Coder
Number of posts : 1366 Age : 27 Location : India Status : Changed my name to Rory Registration date : 2009-02-06
| Subject: Re: PHP & AS intergration URGETNT Thu May 07, 2009 1:28 am | |
| - taddle1 wrote:
- i can kinda understand, not much. I'm new to actionscript
I'm new too! | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Fri May 08, 2009 1:22 pm | |
| | |
|
| |
bubba Lengendary Duck
Number of posts : 1037 Age : 26 Location : Near DC Status : Being awsome (like always). Ask to be my freind. I accept all request! Registration date : 2009-04-19
| Subject: Re: PHP & AS intergration URGETNT Fri May 08, 2009 2:08 pm | |
| Ive never tried it. How does it work? | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Sat May 09, 2009 2:26 am | |
| well, you open a program called flash. (It is a driver and designer software.) You add things that you want. Then, you click on actions and type in the code (usually quite easy) for the thing you want to happen. But when you get advanced like me you will want to use something called php. PHP is a free version of asp really. You either install it to your server or just get a host that supports it. You can use php if you have my sql. (make databases) For example, im making a login test. I have to make a table called Auth in a database. The php file would send flash to the database which would have passwords and usernames. Thats all for now. But dont worry, ill be back with some more things later | |
|
| |
Gamerboy Store Worker
Number of posts : 40 Status : Registration date : 2009-03-30
| Subject: Re: PHP & AS intergration URGETNT Sat May 09, 2009 2:59 am | |
| Erm, you guys are still using the LoadVariables method? Though it is fairly simple to start out with, for a proper game you are probably better off using sockets, SmartFoxServer or similar. | |
|
| |
dj tad GRUB Manager
Number of posts : 160 Status : Coding newsite Registration date : 2009-02-05
| Subject: Re: PHP & AS intergration URGETNT Sat May 09, 2009 6:21 am | |
| | |
|
| |
bubba Lengendary Duck
Number of posts : 1037 Age : 26 Location : Near DC Status : Being awsome (like always). Ask to be my freind. I accept all request! Registration date : 2009-04-19
| Subject: Re: PHP & AS intergration URGETNT Thu May 14, 2009 1:46 pm | |
| | |
|
| |
Sponsored content
| Subject: Re: PHP & AS intergration URGETNT | |
| |
|
| |
| PHP & AS intergration URGETNT | |
|