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实现的敏感词过滤方法示例

本文实例讲述了PHP实现的敏感词过滤方法。分享给大家供大家参考,具体如下: 1、敏感词过滤方法 /** * @todo 敏感词过滤,返回结果 * @param array $li...

PHP数组及条件,循环语句学习

PHP数组及条件,循环语句学习

1. 数组 实例1: 1).效果图预览: 2).代码截图: 以下是一个二维数组, 实际用的比较多. $mess = array('title'=>'留言标题1','conte...

Nginx环境下PHP flush失效的解决方法

问题 我在一次调试PHP逐行输出时候,发现ob_flush和flush两个都失效了,通过phpinfo基本能判断php.ini的设置是正常的。 解决方法 再去看Nginx,发现Nginx...

PHP 函数执行效率的小比较

就是把原来的数组中的数都“拆”成“单”位的。 下面是自己写的一个函数: 复制代码 代码如下: function splitStrToArray_mine($array) { $new_a...

浅谈PHP的排列组合(如输入a,b,c 输出他们的全部组合)

实例如下: <?php /*分治法——直接选择 比如说a b c 首先将a之后的字符依次与a进行交换 1 b,a,c 2 c,b,a 注意这里少了一个原始数据 a,b,...