# PHP var into Flash - it works, but it doesn't

**URL:** https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856
**Category:** programming
**Created:** [July 17, 2003, 1:29am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856 "2003-07-17T01:29:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Freddythunder](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@Freddythunder](https://forum.kirupa.com/u/Freddythunder)
#### Post date: [July 17, 2003, 1:29am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/1 "2003-07-17T01:29:52Z")

</div>

Hey all again,

I’m still dealing with that same stupid Login thing, but it’s a little different this time. When I got it to work, one of the variables ‘status’ is a textbox that say’s whether or not ‘you’re in’ or ‘no soup for you’.

Now all I want to do is xfer a variable that I can use in a gotoAndPlay thing. I’ve tried a thousand times and have searched through the forums here. I tried Ahmed’s script that starts with lv=new LoadVars(); That didn’t work either. I hope it’s something dumb!!!  
Here’s my stuff:

```php

//last lines
if ( $numRow ){
	$auth = 1;
	print "_root.container.checklog=1&_root.container.status=You're in!!";
	
} else {
	$auth = 0;
	print "_root.container.checklog=0&_root.container.status=You're out!!";
	
}
}
?>

```

[AS]  
status = “receiving variables”;  
loadVariables(“htmllogintext.php”, this, “POST”);  
if(checklog = “1”){  
gotoAndStop(62);  
}  
if(checklog = “0”){  
gotoAndStop(61);  
}  
[/AS]  
Can you not use varibles in this way? The script works because the textBox ‘status’ displays what it is supposed to.  
Thank you anyone!!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 17, 2003, 2:52am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/2 "2003-07-17T02:52:35Z")

</div>

take the “\_root.container.” out

php should look like this:

```php

if ( $numRow ){
    $auth = 1;
    print "checklog=1&_root.container.status=You're in!!";
    
} else {
    $auth = 0;
    print "checklog=0&_root.container.status=You're out!!";
    
}
}
?>

```

that should work…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 17, 2003, 3:58am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/3 "2003-07-17T03:58:50Z")

</div>

That didn’t do it. Would there be a prob because the movie that’s calling the vars is a movie loaded into a movie?

I also made a textbox with the var ‘checklog’ to see if it’s working and it stays blank. Is the path messed up?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 17, 2003, 8:08am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/4 "2003-07-17T08:08:53Z")

</div>

Post your fla

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 17, 2003, 10:48pm UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/5 "2003-07-17T22:48:01Z")

</div>

Files - thanks Eyez

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 17, 2003, 10:51pm UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/6 "2003-07-17T22:51:16Z")

</div>

…And here’s the PHP script - just in case anyone wants to see it. I really don’t think that’s the problem.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 19, 2003, 8:13pm UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/7 "2003-07-19T20:13:11Z")

</div>

Bump???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 19, 2003, 9:26pm UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/8 "2003-07-19T21:26:22Z")

</div>

in your PHP:  
$numRow = mysql\_numrows( $result );  
should be  
$numRow = mysql\_num\_rows( $result );  
and  
print “checklog=1&\_root.container.status=You’re in!!”;  
should be  
print “&checklog=1&status=You’re in!!”;  
(there’s no “container” in that fla, and status being on the \_root, that’s all you should need…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 20, 2003, 2:34am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/9 "2003-07-20T02:34:35Z")

</div>

I’ll try the ampersand in front of the var checklog. That fla is actually loaded into a different swf called ucs. Will I need to target the variable when it’s loaded into another movie like the status textbox needs to be?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 22, 2003, 1:56am UTC](https://forum.kirupa.com/t/php-var-into-flash-it-works-but-it-doesnt/25856/10 "2003-07-22T01:56:28Z")

</div>

I tried the changes as you suggested and it still does the same thing. The status text box still changes the way it’s supposed to but the gotoAndPlay(5); still doesn’t work. Was that the only idea you had? I’m lost…:\*(

I’ll post the fla again becuase it has changed a few hundred times. Thanks for any help!!
