veroo
08-01-2007, 08:09 PM
Hi,
I have this problem, hopefully you can help:
(I made test.fla and test.php to illustrate the problem)
test.fla=
function loadEntries() {
// Show Please wait text
txtMessages.text = "Loading entries... Please wait...";
// Begin Loading
var ontvang:LoadVars = new LoadVars();
ontvang.load("test.php");
ontvang.onLoad = function(){
txtMessages.htmlText = ontvang.naam;
//of
this.naam txtMessages2.htmlText = ontvang.email;
//of
this.email
}
}
loadEntries();
stop();
test.php=
$DBhost = "localhost";
// Database Server
$DBuser = "test";
// Database User
$DBpass = "test";
// Database Pass
$DBName = "test";
// Database Name
$table = "test";
// Database Table
// Connect to mySQL Server
$DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " .
mysql_error());
// Select mySQL Database
mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$sql = "SELECT * FROM test WHERE ID = 1";
$rs = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$row = mysql_fetch_assoc($rs);
$name = $row['name'];
$email = $row['email'];
echo('&naam=' . $name . '&email=' . $email . '&');
The output in the textfields (defined in flash) return:
' . $name . '
' . $email . '
I've tried everything (no quotes for $name and $email, single quotes, dubble quotes, ...). If I replace these variables by a string, f.e.
echo('&naam=test&email=test');
it does work! Any clue someone?
Thanks!
I have this problem, hopefully you can help:
(I made test.fla and test.php to illustrate the problem)
test.fla=
function loadEntries() {
// Show Please wait text
txtMessages.text = "Loading entries... Please wait...";
// Begin Loading
var ontvang:LoadVars = new LoadVars();
ontvang.load("test.php");
ontvang.onLoad = function(){
txtMessages.htmlText = ontvang.naam;
//of
this.naam txtMessages2.htmlText = ontvang.email;
//of
this.email
}
}
loadEntries();
stop();
test.php=
$DBhost = "localhost";
// Database Server
$DBuser = "test";
// Database User
$DBpass = "test";
// Database Pass
$DBName = "test";
// Database Name
$table = "test";
// Database Table
// Connect to mySQL Server
$DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " .
mysql_error());
// Select mySQL Database
mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$sql = "SELECT * FROM test WHERE ID = 1";
$rs = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$row = mysql_fetch_assoc($rs);
$name = $row['name'];
$email = $row['email'];
echo('&naam=' . $name . '&email=' . $email . '&');
The output in the textfields (defined in flash) return:
' . $name . '
' . $email . '
I've tried everything (no quotes for $name and $email, single quotes, dubble quotes, ...). If I replace these variables by a string, f.e.
echo('&naam=test&email=test');
it does work! Any clue someone?
Thanks!