« Previous Entry | Main | Next Entry »

memo: Flash, PHP xmlファイル書込み

Author:  |  | (1) comments

-fla
var scope = this;
var lv:LoadVars = new LoadVars();
lv.onLoad = function(success:Boolean):Void {
	//
}
btn_send.onRelease = function() {
	lv.v1 = tf1.text;
	lv.v2 = tf2.text;
	scope.lv.sendAndLoad("test.php", scope.lv, "POST");
}

-php
$v1 = $_POST['v1'];
$v2 = $_POST['v2'];

$xml = domxml_open_file('test.xml');

$node = $xml->create_element('node');
$node->set_attribute('attr', $v1);
$tnode = $xml->create_text_node($v2);
$node->append_child($tnode);

$root = $xml->document_element();
$root->append_child($node);

$xml->dump_file('test.xml');

(1) comments:

said on November 14, 2010

っv

Leave a comment:

 
 
 
Recent Entry
Category Archive
Monthly Archive
About
Powered by
Movable Type 3.33-ja