# Q about : sending php vars to .swf

**URL:** <https://forum.kirupa.com/t/q-about-sending-php-vars-to-swf/67078>\
**Category:** flash\
**Created:** [October 12, 2004, 1:45pm UTC](https://forum.kirupa.com/t/q-about-sending-php-vars-to-swf/67078 "2004-10-12T13:45:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VoS](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@VoS](https://forum.kirupa.com/u/VoS)\
**Post date:** [October 12, 2004, 1:45pm UTC](https://forum.kirupa.com/t/q-about-sending-php-vars-to-swf/67078/1 "2004-10-12T13:45:19Z")

</div>

i have this php page…

```php

<?
include("dbconnect.php"); /// connects to database
//// get data
$SQLstr = "SELECT * FROM programtexter WHERE subject='$select'";
//echo $SQLstr;
$res=mysql_query($SQLstr);
$temp = mysql_fetch_assoc($res);
$id1=$temp['id'];
echo ('_root.pg1text1='.$temp['pg1text1']);
echo ('_root.pg1text2='.$temp['pg1text2']);
echo ('_root.pg1text3='.$temp['pg1text3']);
/// end get data
?>

```

and this flash script to read it

```auto

_root.ran=Math.random()*30234223628762387623;
loadVariables("getprogramtexts.php?select="+_root.program+"&ran="+_root.ran, this, "GET");

```

you can see the .php page in action here  
[http://81.229.231.191/Elias/live/getprogramtexts.php?select=nv](http://81.229.231.191/Elias/live/getprogramtexts.php?select=nv)

and i have a few texts boxxes with the vars

\_root.pg1text1  
\_root.pg1text2  
\_root.pg1text3

ok now that u know what im doing here comes the question

flash reads in the 1st variable \_root.pg1text1 and writes it out on the page ok  
but how do i make it know when theres a new variable. because it also puts the second part in the 1st variable. it does not break up the variables it just puts all the text into \_root.pg1text1

how do i break it up so that each text string is put into the right text string?  
doing \<br\> and haviung spaces between dident work 😉

thanks =)
