flash用php连接数据库的代码

yipeiwu_com6年前PHP代码库
php代码:
复制代码 代码如下:

/* /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代码:
复制代码 代码如下:

#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;

相关文章

浅析php面向对象public private protected 访问修饰符

浅析php面向对象public private protected 访问修饰符

PHP中有三种访问修饰符,分别是:     public(公共的、默认)     protected(受保...

php下关于中英数字混排的字符串分割问题

在网上找了一点时间,发现都不怎样。 后来就自己想了个办法,算是原创吧。 只是用截取加替换的功能。 复制代码 代码如下: function smssubstr($string, $leng...

php数组函数序列之asort() - 对数组的元素值进行升序排序,保持索引关系

asort() 定义和用法 asort() 函数对数组进行排序并保持索引关系。主要用于对那些单元顺序很重要的结合数组进行排序。 可选的第二个参数包含了附加的排序标识。 如果成功则返回 T...

浅析PHP的ASCII码转换类

复制代码 代码如下:class ascii{function decode($str){    preg_match_all( "/(d{2,5})/",...

php全排列递归算法代码

算法原理如果用P表示n个元素的全排列,而Pi表示n个元素中不包含元素i的全排列,(i)Pi表示在排列Pi前面加上前缀i的排列,那么n个元素的全排列可递归定义为:  &...