Jump to content


login with timeline movement


  • You cannot reply to this topic
14 replies to this topic

#1 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 19 February 2007 - 06:02 PM

php:
<?
if(!empty($_POST['uname']) && !empty($_POST['pword']))    {     
$conn = 

mysql_connect("localhost","username","password");
$db = mysql_select_db("database");

$username = $_POST["uname"];
$password = $_POST["pword"];

$result = MYSQL_QUERY("SELECT * from users WHERE 

username='$username'and password='$password'")
   or die ("Name and password not found or not matched");

$worked = mysql_fetch_array($result);

$username = $worked[username];
$password = $worked[password];
$email = $worked[email];

$crap = .$username;
$vars = "".$crap;
echo $var
?>

flash:
on (release) {
	myVars = new LoadVars();
	myVars.uname = username.text;
	myVars.pword = pass.text;
	myVars.load("http://localhost.com/neo.php");
	myVars.onLoad = function(success) {
		if (success) {
			if (this.crap == username.text) {
				gotoAndPlay(2);
			}
		}
	};
}

is that all correct? i'm thinking maybe the "== username.text" might be wrong but im not sure at all :s

if you guys can help that would be amazing!

#2 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 19 February 2007 - 07:03 PM

<?
if(!empty($_POST['uname']) && !empty($_POST['pword']))    {     
$conn = 

mysql_connect("localhost","username","password");
$db = mysql_select_db("database");

$username = $_POST["uname"];
$password = $_POST["pword"];

$result = MYSQL_QUERY("SELECT * from users WHERE 

username='$username'and password='$password'")
   or die ("Name and password not found or not matched");

$worked = mysql_fetch_array($result);

$username = $worked[username];
$password = $worked[password];
$email = $worked[email];

$crap = $username; // removed the . infront of username.
$vars = "crap=".$crap; // added the crap=
echo $var
?>

flash:
on (release) {
	myVars = new LoadVars();
myVars._scope = this; // _scope of where myVars is.  better than using the uname or pword, just incase you get that property from the php in the loadvars.

	myVars.load("http://localhost.com/neo.php");
	myVars.onLoad = function(success) {
		if (success) {
			if (this.crap == this._scope.username.text) {
				this._scope.gotoAndPlay(2);
			}
		}
	};
}

Ok, that should work now. I think? *shrug* give it a whirl. Make sure the // comments out the stuff in php. Im not sure if I need to sue //, /* or somthing else to put comments in php...its been a while.

#3 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 11:30 AM

nope sorry, that didn't work. tried testing the movie and uplaoding the .swf into the same directory on my webserver (which allows php scripting to work). anyone got any ideas whats wrong?

#4 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 11:45 AM

$vars = "crap=".$crap; // added the crap=
echo $var

change that to echo $vars

#5 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 11:59 AM

ok, but what about sending the inputted variables? wouldn't i have to use "myVars.sendAndLoad(http://...."?

#6 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 01:04 PM

You can use either send() or sendAndLoad() with your load vars. SendAndLoad will return data, send will not.

So you may need two loadVars objects...kind of like this:

var lvSendVars:LoadVars = new LoadVars();
var lvRecVars:LoadVars = new LoadVars();

lvSendVars.myVar1 = "someStuff";
lvSendVars.myVar2 = "someMoreStuff";
lvSendVars.myVar3 = "someOtherStuff";

lvSendVars.sendAndLoad("http://www.yoursever.com/thephppage.php", lvRecVars);

lvRecVars.onLoad = function(bSuccess:Boolean){
	  if(bSuccess){
			trace(this.receivedData);
	  }
}

I think that sums it up. Check the code before you used it, I just typed it in to the p2l post window, not in flash, so Im not sure if there are any errors. All data will be set as post variables for your php to use.

#7 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 01:16 PM

right so how would it be if i was trying to trace the $vars varibale that was echoed?

#8 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 01:46 PM

inside the if(success) statement in your onLoad function you would have:

trace(this.crap);

the .crap refers to the first "crap=" below:

$vars = "crap=".$crap;

If you changed it to

$vars = "crappitycrap=".$crap;

you would put:

trace(this.crappitycrap);

#9 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 01:57 PM

ok the trace is coming up with undefined. any idea why it's coming up like that?

Edited by darkson01, 20 February 2007 - 02:09 PM.


#10 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 02:08 PM

In that case it is probably an error in your php. Try running that php page and see what it outputs on the ehco. Chances are that your $crap variable doesnt = anything.

#11 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 02:26 PM

Parse error: parse error, unexpected T_VARIABLE in /localhost/neo.php on line 18

any idea what it means by that?

#12 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 02:58 PM

Found this at: http://codewalkers.c...qlhelp/639.html

I think the last response might be your trouble.

Quote

RE: Parse error: parse error, unexpected T_VARIABLE

by Anonymous on September 16 2003, 20:13


Hello everyone,
I found this code on the internet, Cut and pasted it into a Kate (linux editor) changed it up to hit the database. After reading all of your post and seeing your responses that the code looked right and it seemed to stump you guys and gals. I went to the end of each line and deleted the formatting and did hard returns with out the tabs etc...... Guess what the code works l like a charm.

So a heads up, if you cut and paste the code into Kate / editor off the internet, might want to redo the formatting.
Thanks so much for everyone that posted and helped out.
Jp

Edit:
After some further reading, it looks like it might also be caused by missing semi-colons...just check to make sure all your syntax is right.

Edited by Pax, 20 February 2007 - 02:59 PM.


#13 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 02:59 PM

fixed it and it comes up "crap= "

i then changed the username and password variables coming into flash into the username and password i've been entering in flash and it still comes up "crap= "

the username and password i am entering is exactly whats store din the database

whats going on?

Edited by darkson01, 20 February 2007 - 03:01 PM.


#14 darkson01

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Gfx, skateboarding, playing guitar, listening to punk music and flash!

Posted 20 February 2007 - 03:41 PM

ok don't worry about it, i used a tutorial for what i wanted to make. thanks for the help though!

#15 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 February 2007 - 03:51 PM

np mate...glad you got things working. Was the solution close to what you already had?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users