if u take out the print line, and u just echo the XML it should work properly...


----- Mensaje original ----
De: ghus32 <[EMAIL PROTECTED]>
Para: [email protected]
Enviado: martes, 24 de junio, 2008 19:56:47
Asunto: [flexcoders] passing data from PHP to Flex


Hello everyone,

I have an upload script that I am using in Flex with PHP. The upload 
function is working fine, but I want to pass data from the serverside 
script back to the app. I want to communicate the message part in the 
php back to Flex.

HOw would I go about doing this..

My PHP code is below

$uploaddir = TEMPLATE_DIRECTORY;
$filename= trim($_FILES[ 'file'][' name']);

if(is_uploaded_ file($_FILES[ 'file'][' tmp_name' ]))
{


$id = time().mt_rand( 0,10000);
$file = $id;


move_uploaded_ file($_FILES[ 'file'][' tmp_name' ],$uploaddir. $file);

$filepath=$uploaddi r.'/';

$query_filename= "INSERT INTO template(name, location, temp_name) 
VALUES ('$filename' , '$filepath' , '$file')";

$result_filename = mysql_query( $query_filename );

}
print "Your file has been uploaded successfully! Yay!";

$message =  "<result><message> $file 
uploadedsuccessfull y.</message> </result> ";
echo $message;

    


      ______________________________________________ 
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.

Reply via email to