hello guys,
i have this actionscript in a keyframe
loadText = new LoadVars();
loadText.load(“http://localhost/FOR_FLASH/sites.php”);
//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:
<?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;
?>
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”
(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