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添加xml文档内容的方法

本文实例讲述了通过php添加xml文档内容的方法。分享给大家供大家参考。具体分析如下: 这里讲述的添加xml文档内容,从上一篇《DOM基础及php读取xml内容操作的方法》继续,代码如下...

php自定义urlencode,urldecode函数实例

本文实例讲述了php自定义urlencode,urldecode函数。分享给大家供大家参考。具体如下: //配合JavaScript的ajaxObject函数, 对字串进行转码. f...

php使用glob函数遍历文件和目录详解

php glob()函数返回匹配指定模式的文件名或目录。因此我们可以使用glob函数来查找文件,也可以实现目录的遍历。 函数说明:array glob ( string $pattern...

php文件包含目录配置open_basedir的使用与性能详解

1.open_basedir介绍 open_basedir 将php所能打开的文件限制在指定的目录树中,包括文件本身。当程序要使用例如fopen()或file_get_contents(...

php流量统计功能的实现代码

流量统计功能 显示效果: 总访问量:399 今日流量:14 昨日流量:16 本代码仅供学习交流,其中必有不妥之处。请见谅! -- -- 表的结构 `mycounter` -- 复制代码...