Hi,
I’m new to loading dynamic content, so i made a test file.
I’ve given a dynamic textfield the variable name “msg” and converted it into a movieclip symbol. This is all there is on the stage.
Attached to this movieclip is the following action:
onClipEvent (load) {
LoadVariables (“message.txt”,this);
}
In the same directory where the published .swf resides i have a textfile called message.txt, and it’s contents shows up perfecty in this .swf
BUT:
Now i want to load data from MySQL via PHP, instead of loading it from the textfile, so in the actionscript I change the .txt extension into .php (the name of the PHP-file is also “message”) This php-file resides in the same directory as the textfile, and register_globals is on in my php.ini file. Still my .swf does not show anything! Why???
When i check the file “message.php” in my webbrowser it perfectly retrieves the data from my (local)database, showing:
msg=Contents+from+database. So that seems to work. But flash does’nt show anything.
This is the message.php file i’m using:
*<title>Uit No Hands/DevShed</title><?
// message.php
// open connection to database
$connection = mysql_connect(“localhost”, “root”, “rolf”) or die
(“Unable to connect!”);
mysql_select_db(“rolf”) or die (“Unable to select database!”);
// formulate and execute query
$query = “SELECT testveld FROM test”;
$result = mysql_query($query) or die("Error in query: " .
mysql_error());
// get row
$row = mysql_fetch_object($result);
// print output as form-encoded data
echo “msg=” . urlencode($row->testveld);
// close connection
mysql_close($connection);
?>*
Hope someone can help!
Rolf