Jump to content
Sign in to follow this  
Ivan22

enviar vars flash para php?

Recommended Posts

Ivan22

ola

alguem pode eplicar me como passo variaveis flash para o php?

eu tenho isto FLASH (as2):

var envioVariaveis:LoadVars = new LoadVars();

envioVariaveis.cor="azul";

envioVariaveis.sendAndLoad("ficheiro.php",this,"POST");

no PHP:

echo "cor escolhida foi: ".$_REQUEST['cor'].'<br>';

....não passa valor nenhum para lá

obrigado.

Share this post


Link to post
Share on other sites
rexmage

NO FLASH tens algo assim:

System.useCodepage = true;
var arquivo:XML = new XML();

arquivo.load("newsXML.php");
arquivo.ignoreWhite = true;
arquivo.onLoad = function() {

new.text = this.childNodes[0].childNodes[0].attributes.new;
}

stop();

No file php, faz o seguinte:

 <?PHP

$link = mysql_connect("localhost","user","pw");
mysql_select_db("sitenoticias");

$query = 'SELECT newROW FROM newsbd LIMIT 1';
$results = mysql_query($query);

echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
echo "<post>\n";

while($line = mysql_fetch_assoc($results)) {
echo "<new new='$line[new]'/>\n";
}

echo "</post>\n";
mysql_close($link);

?>

Como ja deves ter reparado aqui no que escrevi usa xml pra passar vars.

Se alguém puder por outras formas força, assim ficas com mais exemplos :P

Espero que ajude ;D


<?PHP echo "Bo0m"; ?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.