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具有完整的反射API,提供了对类、接口、函数、方法和扩展进行逆向工程的能力。通过类的反射提供的能力我们能够知道类是如何被定义的,它有什么属性、什么方法、方法都有哪些参数,类文件的路...

php简单创建zip压缩文件的方法

本文实例讲述了php简单创建zip压缩文件的方法。分享给大家供大家参考,具体如下: /* creates a compressed zip file */ function crea...

php对二维数组进行相关操作(排序、转换、去空白等)

技巧提示: array_keys($array) //返回所有键名 array_values($array) //返回所有键值 $result=array_rever...

php下用cookie统计用户访问网页次数的代码

如何创建 cookie? setcookie() 函数用于设置 cookie。 注释:setcookie() 函数必须位于 <html> 标签之前。 创建您的第一个PHP c...

php 设计模式之 单例模式

小船类boat.php复制代码 代码如下:<?php class boat { private static $instance=null; private $skipper; p...