flash用php连接数据库的代码

yipeiwu_com5年前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实现多进程并行操作的详解(可做守护进程)

如下所示:复制代码 代码如下:/** * 入口函数 * 将此文件保存为 ProcessOpera.php * 在terminal中运行 /usr/local...

php读取目录所有文件信息dir示例

复制代码 代码如下: <?php set_time_limit(0); function tree($directory) { $mydir=dir($directory); ec...

PHP动态生成指定大小随机图片的方法

本文实例讲述了PHP动态生成指定大小随机图片的方法。分享给大家供大家参考,具体如下: <?php $image_width = 100; $image_height =...

smarty静态实验表明,网络上是错的~呵呵

复制代码 代码如下:<?   require_once("Smarty/libs/Smarty.class.php");   $smarty...

php过滤所有的空白字符(空格、全角空格、换行等)

在php中自带的trim函数只能替换左右两端的空格,感觉在有些情况下不怎么好使,如果要将一个字符串中所有空白字符过滤掉(空格、全角空格、换行等),那么我们可以自己写一个过滤函数。 php...