# No string displayed from a php file

**URL:** <https://forum.kirupa.com/t/no-string-displayed-from-a-php-file/269920>\
**Category:** Uncategorized\
**Created:** [September 3, 2008, 5:48am UTC](https://forum.kirupa.com/t/no-string-displayed-from-a-php-file/269920 "2008-09-03T05:48:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lenems](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lenems](https://forum.kirupa.com/u/lenems)\
**Post date:** [September 3, 2008, 5:48am UTC](https://forum.kirupa.com/t/no-string-displayed-from-a-php-file/269920/1 "2008-09-03T05:48:10Z")

</div>

hello guys,

i have this actionscript in a keyframe

loadText = new LoadVars();  
loadText.load(“[http://localhost/FOR\_FLASH/sites.php](http://localhost/FOR_FLASH/sites.php)”);  
[//loadText.load](https://loadText.load)(“data.txt”);  
loadText.onLoad = function()  
{  
name.text = this.name;  
};

it should display into a textfield named “name” the content  
of the variable named “name” (from an external file).  
this code works if the external file is a txt file:

loadText.load(“data.txt”);

the file contains the string:  
name=ken  
“ken” is displayed on the textfield (on the flash movie)

but if i change the external file into a php file which generates the same  
string, the code is as follows:

```
&lt;?php
mysql_pconnect ("localhost", "root", "");

mysql_select_db ("personnel_dtr");
$qResult = mysql_query ("SELECT fname FROM tblemployee where emp_id = '041083'");
$nRows = mysql_num_rows($qResult);
$rString ="";

$row = mysql_fetch_array($qResult);
$rString = "name=".$row['fname'];

echo $rString;
 

?&gt;

```

the code above echos / displays the string “name=ken” just like  
the txt file.

note: i think there is no issues on the file paths,  
there’s no error generated whatsoever  
regarding it… it’s just that nothing is displayed in the textfield  
so i figured out it has to be the php file.  
but if i display the php file on a browser given the url “[http://localhost/FOR\_FLASH/sites.php](http://localhost/FOR_FLASH/sites.php)”  
(stored on a web server) the string “name=ken” is displayed

i’m using flash mx (flash 6.0 r25), WAMP5 (apache, php, mysql)

i’d appreciate any help, please…

thanks
