Hi there!
I am managing a Directory covering several Schools.
It is all Flash built.
One of the numerous Search functions it offers is:
for a given school and a given year get the list of students.
The list gives for each student: Name, First Name, eventually Mention of decease, Email address if any and, finally, code of the Geographical region where the student lives.
How can I get my script returning a HTML formatted flashstring (color, font, email link) so it doesn't appear as a "boring" list displayed in the same font with the same color and no differenciation for the email address?*
I have tried to insert HTML Tags in the $flashstr line of the PHP Script but when I do this, the Flash file displays nothing even if the PHP Script works and prints good (please check it out on demand).
I have used the right AS in Flash (see below)
Many thanks in advance for your help!
Regards,
Gerard
The script I use is:
<?php
include 'key.php';
$table = "annuaire";
$ecole = $_POST[ "secole" ];
$promotion = $_POST[ "promoyear" ];
mysql_connect( $host ,$user ,$pass) or die( "cannot connect " .mysql_error () );
mysql_select_db( $db ) or die( "cannot select db " .mysql_error () );
$result =mysql_query ("SELECT lastName, firstName, gone, email, region FROM $table WHERE list like '%$ecole%' AND promo like '%$promotion%' ORDER BY lastName, firstName " ) or die ( "select error " .mysql_error () );
if ( mysql_num_rows( $result ) > 0) {
$flashstr ="&listetotale=";
while ($row =mysql_fetch_array ($result ) ) {
$flashstr .= "<font color= red>"."<b>".$row ["lastName" ]." ".$row ["firstName" ]."</b>"."</font>".$row ["gone" ]." "."<font color= green>".$row ["email" ]."</font>"." ".$row ["region" ]."\r";
}
print ("&erreur="." "."&compte=".mysql_num_rows($result)." ".$flashstr);
}
else
print ("&erreur=Aucun élève répertorié."." "."&compte="." "."&listetotale=");
?>
And the ActionScript in my Search Button:
on (release, keyPress "<Enter>") {
mySearch2.secole = _root.sList.text;
trace(secole);
mySearch2.promoyear = _root.sPromo.text;
trace(promoyear);
mySearch2.onLoad = function(success) {
if (success) {
_root.listAmount.text = mySearch2.compte;
_root.fFullList.html = true;
_root.fFullList.htmlText = mySearch2.listetotale;
} else {
_root.fErrorMsg.text = mySearch2.erreur;
}
};
mySearch2.sendAndLoad("search17.php", mySearch2, 'POST');
}