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 cli 方式 在crotab中运行解决

复制代码 代码如下: /var/www/html/bt/e/BtSys:.:/usr/share/pear:/usr/share/phpPHP Warning: require(../c...

PHP-FPM运行状态的实时查看及监控详解

PHP-FPM运行状态的实时查看及监控详解

前言 大家都知道PHP-FPM内置了状态页,开启后可查看PHP-FPM的详细运行状态,给PHP-FPM优化带来帮助。 打开php-fpm.conf,配置php-fpm状态页选项 p...

PHP设计模式之模板方法模式定义与用法详解

本文实例讲述了PHP设计模式之模板方法模式定义与用法。分享给大家供大家参考,具体如下: 什么是模板方法模式 模板方法(Template Method)设计模式中使用了一个类方法templ...

PHP 配置文件中open_basedir选项作用

如下是php.ini中的原文说明以及默认配置: ; open_basedir, if set, limits all file operations to the defined dir...

php实现文章置顶功能的方法

本文实例讲述了php实现文章置顶功能的方法。分享给大家供大家参考,具体如下: 昨天客户让做文章置顶的功能。自己以前没做过。靠着同事的指点才做了出来。本来挺简单的事情,被自己搞了好久。自己...