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实现在对象之外访问其私有属性private及保护属性protected的方法

本文实例讲述了PHP实现在对象之外访问其私有属性private及保护属性protected的方法。分享给大家供大家参考,具体如下: public 表示全局的访问权限,类内部外部子类都可以...

3种php生成唯一id的方法

小编在网上查了许多关于php生成唯一id方法的文章,发现有很多的方法,特整理本文与大家分享php生成唯一id的解决方法,希望大家喜欢。 1、md5(time() . mt_rand(1,...

php计算给定日期所在周的开始日期和结束日期示例

本文实例讲述了php计算给定日期所在周的开始日期和结束日期。分享给大家供大家参考,具体如下: <?php /** * 取得给定日期所在周的开始日期和结束日期 * @...

php小偷相关截取函数备忘

截取函数 复制代码 代码如下: function cut($file,$from,$end){ $message=explode($from,$file); $message=explo...

用PHP代码给图片加水印

用PHP代码给图片加水印

先找好一张图片,更名为face.jpeg,创建watermark.php: <?php /** * Created by PhpStorm. * User: A...