<?xml version="1.0" encoding="UTF-8" ?>
<clientSet>
<server url="192.168.0.180" port="1935" />
<rootPath value="" />
<homePath value="http://www.flashpioneer.com" />
<helpPath value="help.html" />
<language value="en" />
<theme value="default" />
<visibleMarquee value = "true" />
<visibleWhitePaper value="true" />
<showMemberRoomForGuest value = "true" />
<emotions enabled="true" column="5" autoPlay="false">
<item name="Birthday" src="cartoon/movie/birthday.swf" thumb="cartoon/preview/birthday-small.swf" duration="15"/>
<item name="Boom" src="cartoon/movie/boom.swf" thumb="cartoon/preview/boom-small.swf" duration="6"/>
<item name="Bubble" src="cartoon/movie/bubble.swf" thumb="cartoon/preview/bubble-small.swf" duration="7.5"/>
<item name="Cry" src="cartoon/movie/cry.swf" thumb="cartoon/preview/cry-small.swf" duration="5.4"/>
<item name="Doggie" src="cartoon/movie/doggie.swf" thumb="cartoon/preview/doggie-small.swf" duration="13"/>
<item name="Greeting" src="cartoon/movie/greeting.swf" thumb="cartoon/preview/greeting-small.swf" duration="7.4"/>
</emotions >
<preDefinedMsg>
<msg value="Time is up."/>
<msg value="Hello, can I help you?"/>
<msg value="May I have your name and E-Mail address please?"/>
<msg value="Could you please give more detailed steps so that we can reproduce the problem on our side?"/>
<msg value="Wait a minute please; I am now checking the problem for you."/>
<msg value="I will send the relevant information to you via email; please remember to check your mailbox for it."/>
<msg value="My pleasure."/>
<msg value="If you have any questions on the details, feel free to ask. "/>
</preDefinedMsg>
</clientSet>最后两个节点的子节点属性读取 删除 增加 修改时都能用ajax实现,实现无刷新
修改 的要求 点击某一节点的修改链接,能把值读取到对应的文本框中,然后进行修改
PHP语言 PHP5以下版本
<clientSet>
<server url="192.168.0.180" port="1935" />
<rootPath value="" />
<homePath value="http://www.flashpioneer.com" />
<helpPath value="help.html" />
<language value="en" />
<theme value="default" />
<visibleMarquee value = "true" />
<visibleWhitePaper value="true" />
<showMemberRoomForGuest value = "true" />
<emotions enabled="true" column="5" autoPlay="false">
<item name="Birthday" src="cartoon/movie/birthday.swf" thumb="cartoon/preview/birthday-small.swf" duration="15"/>
<item name="Boom" src="cartoon/movie/boom.swf" thumb="cartoon/preview/boom-small.swf" duration="6"/>
<item name="Bubble" src="cartoon/movie/bubble.swf" thumb="cartoon/preview/bubble-small.swf" duration="7.5"/>
<item name="Cry" src="cartoon/movie/cry.swf" thumb="cartoon/preview/cry-small.swf" duration="5.4"/>
<item name="Doggie" src="cartoon/movie/doggie.swf" thumb="cartoon/preview/doggie-small.swf" duration="13"/>
<item name="Greeting" src="cartoon/movie/greeting.swf" thumb="cartoon/preview/greeting-small.swf" duration="7.4"/>
</emotions >
<preDefinedMsg>
<msg value="Time is up."/>
<msg value="Hello, can I help you?"/>
<msg value="May I have your name and E-Mail address please?"/>
<msg value="Could you please give more detailed steps so that we can reproduce the problem on our side?"/>
<msg value="Wait a minute please; I am now checking the problem for you."/>
<msg value="I will send the relevant information to you via email; please remember to check your mailbox for it."/>
<msg value="My pleasure."/>
<msg value="If you have any questions on the details, feel free to ask. "/>
</preDefinedMsg>
</clientSet>最后两个节点的子节点属性读取 删除 增加 修改时都能用ajax实现,实现无刷新
修改 的要求 点击某一节点的修改链接,能把值读取到对应的文本框中,然后进行修改
PHP语言 PHP5以下版本
<?php
$DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];
require_once($DOC_ROOT."/dao/My_Mysqli.php");
require_once($DOC_ROOT."/dao/MyPDO.php");
require_once($DOC_ROOT."/exceptions.php");
class ActiveComputerActionXML{ var $username;
var $password;
var $computer_name;
var $kad_id;
var $computer_type;
var $cnt;
var $error;
var $pkg_no;
var $secure_msg;
var $src_computer;
var $src_user;
var $dst_computer;
var $dst_user;
var $charset = "utf-8";
var $update_result;
var $account_status;
var $key_location; function ActiveComputerActionXML($request) {
// SIMPLEXML OBJECT CALLBACK
$this->pkg_no = trim($request->head->{'pkg-no'});
$this->src_computer = trim($request->head->{'dst-computer'});
$this->dst_computer = trim($request->head->{'src-computer'});
$this->src_user = trim($request->head->{'dst-user'});
$this->dst_user = trim($request->head->{'src-user'});
$this->username = trim($request->body->{'user-id'});
$this->password = trim($request->body->password);
$this->kad_id = trim($request->body->{'kad-id'});
$this->computer_type = trim($request->body->{'computer-type'});
$this->computer_name = trim($request->body->{'computer-name'}); // Store procedure callback
$mysqli = new My_Mysqli();
$query = "CALL sp_add_user_computer('$this->username','$this->password','$this->computer_name','$this->computer_type','$this->kad_id',@acct_status,@key_location,@error_code);SELECT @acct_status,@key_location,@error_code;";
$mysqli->call_sp($query);
$mysqli->close_sp();
$row = $mysqli->row[0];
$this->account_status = strtolower($row[0]);
$this->key_location = $row[1];
switch ($row[2]){
case 1:
$this->cnt = 1;
$this->error = 'Account does not exist!';
break;
case 2:
$this->cnt = 2;
$this->error = 'Password does not match!';
break;
case 0:
@session_start();
session_cache_expire(30);
$this->secure_msg= sha1($this->username)."+".crc32(session_id());
$this->cnt = 0;
$this->error = "Success!";
$_SESSION['username'] = $this->username;
$_SESSION['secure_msg'] = $this->secure_msg;
break;
}
}
function XMlResponseOutput(){
$dom = new DOMDocument('1.0',$this->charset);
$root = $dom->createElement('root');
$root->setAttribute('protocal-version','1.0');
$dom->appendChild($root);
$head = $dom->createElement('head');
$dom->appendChild($head);
$cmd = $dom->createElement('cmd','activate-computer-rsp');
$dom->appendChild($cmd);
$pkg_no = $dom->createElement('pkg-no',$this->pkg_no);
$dom->appendChild($pkg_no);
$dst_user = $dom->createElement('dst-user',$this->dst_user);
$dom->appendChild($dst_user);
$dst_computer = $dom->createElement('dst-computer',$this->dst_computer);
$dom->appendChild($dst_computer);
$src_user = $dom->createElement('src-user',$this->src_user);
$dom->appendChild($src_user);
$src_computer = $dom->createElement('src-computer',$this->src_computer);
$dom->appendChild($src_computer);
$rsp_code = $dom->createElement('rsp-code',$this->cnt);
$dom->appendChild($rsp_code);
$rsp_msg = $dom->createElement('rsp-msg',$this->error);
$dom->appendChild($rsp_msg);
$head->appendChild($cmd);
$head->appendChild($pkg_no);
$head->appendChild($dst_user);
$head->appendChild($dst_computer);
$head->appendChild($src_user);
$head->appendChild($src_computer);
$head->appendChild($rsp_code);
$head->appendChild($rsp_msg);
$root->appendChild($head);
if ($this->cnt == 0){
$body = $dom->createElement('body');
$dom->appendChild($body);
$secure_msg = $dom->createElement('secure-msg',$this->secure_msg);
$dom->appendChild($secure_msg);
$body->appendChild($secure_msg);
$account_status = $dom->createElement('acount-status',$this->account_status);
$dom->appendChild($account_status);
$key_location = $dom->createElement('private-key',$this->key_location);
$dom->appendChild($key_location);
$body->appendChild($account_status);
$body->appendChild($key_location);
$root->appendChild($body);
}
$xml_file = $dom->saveXML();
echo $xml_file;
}}?>
只不javascript在浏览器中才可以将XML格式化为DOM
只有DOM才能操作节点
作以,要操作DOM只有在浏览器中在PHP后台,只能输出XML,phP不能将xml格式化为DOM,所以就无法作DOM操作节点
所以,直接用ajax+php写就行了,至于怎么写,个人觉得和xml差不多了!
给楼主个链接(不是广告哦),php+oracle+ajax,例子看了大概就知道怎么用了:
http://searchwebservices.techtarget.com.cn/tips/488/3160488.shtml
我要做的就是操作这个“数据库” 删除 修改 增加最后两项需要无刷新页面
现在无刷新增加我能够实现,但及时的显示就不行了。删除和修改呢没有思路
最后提供一个保存按钮,调用ajax,将客户端修改过的xml内容保存到服务器端。
我想做的就是你说的这种效果 但不知道怎么做
把所有的xml内容读出来 然后进行客户端操作 操作完成了在统一提交到服务器端
读可以读出来 但用js在客户端操作不是很熟悉 对JS不是特别的熟 希望能介绍个例子