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编程实现多维数组按照某个键值排序的方法小结【2种方法】

PHP编程实现多维数组按照某个键值排序的方法小结【2种方法】

本文实例讲述了PHP编程实现多维数组按照某个键值排序的方法。分享给大家供大家参考,具体如下: 实现对多维数组按照某个键值排序的两种解决方法(array_multisort和array_s...

php实现过滤字符串中的中文和数字实例

本文实例讲述了php实现过滤字符串中的中文和数字。分享给大家供大家参考。具体实现方法如下: function getChinese($string,$encode="GBK") {...

PHP小技巧之JS和CSS优化工具Minify的使用方法

一、实现合并和压缩多个JS和CSS文件的代码 HTML: 复制代码 代码如下:<link rel="stylesheet" type="text/css" href="cssmin...

php 短链接算法收集与分析

短链接就不说了,大家已经都清楚了,如下所示就是短链接: 新浪微博 http://t.cn/SVpONM 腾讯微博 http://url.cn/302yor Yun.io http://d...

php使用PDO方法详解

本文详细分析了php使用PDO方法。分享给大家供大家参考。具体分析如下: PDO::exec:返回的是int类型,表示影响结果的条数. 复制代码 代码如下:PDOStatement::e...