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中使用数组指针函数操作数组示例

数组的内部指针是数组内部的组织机制,指向一个数组中的某个元素。默认是指向数组中第一个元素通过移动或改变指针的位置,可以访问数组中的任意元素。对于数组指针的控制PHP提供了以下几个内建函数...

PHP计算数组中值的和与乘积的方法(array_sum与array_product函数)

本文实例讲述了PHP计算数组中值的和与乘积的方法。分享给大家供大家参考,具体如下: 一、概述: array_sum() 函数用于计算数组中所有值的和。 array_product() 函...

thinkphp3.0 模板中函数的使用

变量的来源: 1 从php分配的变量,使用assign分配 2 系统变量 3 路径替换变量 不能使用函数的变量 变量输出快捷标签 {@var}//输出Session变量 和{$Think...

领悟php接口中interface存在的意义

可能大家都懂这些,作为不懂的我猜测了一下这个interface的意义,他就是为了后面调用的时候再调用的方法中调用实现类中interface中存在的内容,好绕口啊,写个例子留作以后看吧pa...

Linux下快速搭建php开发环境

Linux下快速搭建php开发环境

一、Linux下快速搭建php开发环境 1.安装XAMPP for Linux XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包,使用XAMPP可快...