flash用php连接数据库的代码

yipeiwu_com5年前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图片处理:加水印、缩略图的实现(自定义函数:watermark、thumbnail)

废话不说了,贴代码: 复制代码 代码如下: <?php /************************************ //函数: watermark($bigimg,...

PHP实现多维数组转字符串和多维数组转一维数组的方法

本文实例讲述了PHP实现多维数组转字符串和多维数组转一维数组的方法。分享给大家供大家参考。具体实现方法如下: /** * @method 多维数组转字符串 * @param ty...

自制PHP框架之设计模式

为什么要使用设计模式? 设计模式,我的理解是为了达到“可复用”这个目标,而设计的一套相互协作的类。 感兴趣的读者可以阅读《Design Patterns: Elements of Reu...

PHP 7.1新特性的汇总介绍

一、可空类型 可空类型主要用于参数类型声明和函数返回值声明。 主要的两种形式如下: <?php function answer(): ?int { retur...

PHP经典Redis操作类 调用方便,操作简单

/**  * redis操作类  * 说明,任何为false的串,存在redis中都是空串。  * 只有在key不存在时,才会返回fa...