flash用php连接数据库的代码

前端之家收集整理的这篇文章主要介绍了flash用php连接数据库的代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

PHP代码
<div class="codetitle"><a style="CURSOR: pointer" data="33787" class="copybut" id="copybut33787" onclick="doCopy('code33787')"> 代码如下:

<div class="codebody" id="code33787">
/ /flashservices/services/Catalog.PHP /
class Catalog {
var $products_array = array(); // Constructor: Contains the list of methods available to the gateway
function Catalog() {
$this->methodTable = array (
"getProducts" => array (
"description" => "Get list of products",
"access" => "remote",
"arguments" => "" // arguments could be optional,not tested
)
); // end methodTable
} function getProducts() {
// your code goes here return $this->products_array;
}
}

actionscript代码
<div class="codetitle"><a style="CURSOR: pointer" data="25501" class="copybut" id="copybut25501" onclick="doCopy('code25501')"> 代码如下:
<div class="codebody" id="code25501">
#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://yourserver.com/flashservices/gateway.PHP");
gw = NetServices.createGatewayConnection();
CatalogREMOTE = gw.getService("Catalog",this);
CatalogREMOTE.getProducts(); getProducts_Result = function(result) {
_root.products_results = result;
}

原文链接:https://www.f2er.com/php/28040.html

猜你在找的PHP相关文章