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类的静态(static)方法和静态(static)变量使用介绍

在php中,访问类的方法/变量有两种方法: 1. 创建对象$object = new Class(),然后使用”->”调用:$object->attribute/functi...

php删除txt文件指定行及按行读取txt文档数据的方法

本文实例讲述了php删除txt文件指定行及按行读取txt文档数据的方法。分享给大家供大家参考,具体如下: 向txt文件循环写入值: $keys = range(1,999); $fi...

PHP进阶学习之Geo的地图定位算法详解

PHP进阶学习之Geo的地图定位算法详解

本文实例讲述了PHP进阶学习之Geo的地图定位算法。分享给大家供大家参考,具体如下: 前言 日常开发中我们经常需要查找某个物体的定位,或者查找附近的范围等,我们自然而然会想到的方法就是...

php开发微信支付获取用户地址

使用微信获取地址信息是和微信支付一道申请的,微信支付申请通过,就可以使用该功能。 微信商城中,使用微信支付获取用户的收货地址,可以省略用户输入地址信息的繁复流程,提高用户体验。 但是可能...

PHP 5.3和PHP 5.4出现FastCGI Error解决方法

不少童鞋在配置完PHP 5.3或者PHP 5.4网站源码后打开出错,提示 复制代码 代码如下: FastCGI Error The FastCGI Handler was unable...