# Problem Getting PHP Variables into Flash

**URL:** <https://forum.kirupa.com/t/problem-getting-php-variables-into-flash/253565>\
**Category:** programming\
**Created:** [March 3, 2008, 3:22am UTC](https://forum.kirupa.com/t/problem-getting-php-variables-into-flash/253565 "2008-03-03T03:22:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SniperDave](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SniperDave](https://forum.kirupa.com/u/SniperDave)\
**Post date:** [March 3, 2008, 3:22am UTC](https://forum.kirupa.com/t/problem-getting-php-variables-into-flash/253565/1 "2008-03-03T03:22:25Z")

</div>

I’ve been following this tutorial on using Flash with PHP and mySQL:

[http://www.kirupa.com/developer/actionscript/flash\_php\_mysql.htm](http://www.kirupa.com/forum/../developer/actionscript/flash_php_mysql.htm)

And I’m sort of stumbling at the first fence. I’ve got the dynamic text field set up with the variable myVar inside a movieclip with the actionScript:

> onClipEvent (load) {  
> loadVariables(“[http://www.mywebsite.co.uk/stuff/phpflash/test.php](http://www.mywebsite.co.uk/stuff/phpflash/test.php)”, this, “GET”);  
> }  
> And I’ve made and uploaded test.php:

> \<?php  
> $x = “abc”;  
> print “myVar=$x”;  
> ?\>  
> I’ve opened test.php, and it says ‘myVar=abc’ like it should.

Now when I try to preview my flash movie I get this error message:

> Error opening URL ‘[http://www.mywebsite.co.uk/stuff/phpflash/test.php?myVar=\<p+align%3D"center"\>\<%2Fp\>](http://www.mywebsite.co.uk/stuff/phpflash/test.php?myVar=%3Cp+align%3D%22center%22%3E%3C%2Fp%3E)’  
> As far as I can tell, its sending a bunch of data from the text field to the PHP which is mucking it up (I’m guessing this because when I change the text field’s alignment from center to left the error changes to ‘align%3D%22left’).

Does anyone know what I’m doing wrong?

Thanks.
